KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > knowgate > dataxslt > Image


1 /*
2   Copyright (C) 2003 Know Gate S.L. All rights reserved.
3                       C/Oņa, 107 1š2 28050 Madrid (Spain)
4
5   Redistribution and use in source and binary forms, with or without
6   modification, are permitted provided that the following conditions
7   are met:
8
9   1. Redistributions of source code must retain the above copyright
10      notice, this list of conditions and the following disclaimer.
11
12   2. The end-user documentation included with the redistribution,
13      if any, must include the following acknowledgment:
14      "This product includes software parts from hipergate
15      (http://www.hipergate.org/)."
16      Alternately, this acknowledgment may appear in the software itself,
17      if and wherever such third-party acknowledgments normally appear.
18
19   3. The name hipergate must not be used to endorse or promote products
20      derived from this software without prior written permission.
21      Products derived from this software may not be called hipergate,
22      nor may hipergate appear in their name, without prior written
23      permission.
24
25   This library is distributed in the hope that it will be useful,
26   but WITHOUT ANY WARRANTY; without even the implied warranty of
27   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
28
29   You should have received a copy of hipergate License with this code;
30   if not, visit http://www.hipergate.org or mail to info@hipergate.org
31 */

32
33 package com.knowgate.dataxslt;
34
35 import org.w3c.dom.Node JavaDoc;
36
37 import dom.DOMSubDocument;
38
39 /**
40  * Image element into a Block of a PageSet.
41  *
42  * @author Sergio Montoro Ten
43  * @version 1.0
44  */

45 public class Image extends DOMSubDocument {
46
47   /**
48    * @param oRefNode DOMDocument Node holding <image> element.
49    */

50
51   public Image(Node JavaDoc oRefNode) {
52     super(oRefNode);
53   }
54
55   // ----------------------------------------------------------
56

57   public String JavaDoc id() {
58     Node JavaDoc oItem = oNode.getAttributes().getNamedItem("id");
59
60     if (null==oItem)
61       return null;
62     else
63       return oItem.getNodeValue();
64   } // id()
65

66   // ----------------------------------------------------------
67

68   public String JavaDoc url() {
69     if (null==getElement("url"))
70       return "";
71     else
72       return getElement("url");
73   } // id()
74

75   public String JavaDoc path() {
76     if (null==getElement("path"))
77       return "";
78     else
79       return getElement("path");
80   } // id()
81

82   public String JavaDoc width() {
83     if (null==getElement("width"))
84       return "";
85     else
86       return getElement("width");
87   } // id()
88

89   public String JavaDoc height() {
90     if (null==getElement("height"))
91       return "";
92     else
93       return getElement("height");
94   } // id()
95

96   public String JavaDoc alt() {
97     if (null==getElement("alt"))
98       return "";
99     else
100       return getElement("alt");
101   } // id()
102

103   // ----------------------------------------------------------
104
}
Popular Tags