001: /*
002: Copyright (C) 2003 Know Gate S.L. All rights reserved.
003: C/Oņa, 107 1š2 28050 Madrid (Spain)
004:
005: Redistribution and use in source and binary forms, with or without
006: modification, are permitted provided that the following conditions
007: are met:
008:
009: 1. Redistributions of source code must retain the above copyright
010: notice, this list of conditions and the following disclaimer.
011:
012: 2. The end-user documentation included with the redistribution,
013: if any, must include the following acknowledgment:
014: "This product includes software parts from hipergate
015: (http://www.hipergate.org/)."
016: Alternately, this acknowledgment may appear in the software itself,
017: if and wherever such third-party acknowledgments normally appear.
018:
019: 3. The name hipergate must not be used to endorse or promote products
020: derived from this software without prior written permission.
021: Products derived from this software may not be called hipergate,
022: nor may hipergate appear in their name, without prior written
023: permission.
024:
025: This library is distributed in the hope that it will be useful,
026: but WITHOUT ANY WARRANTY; without even the implied warranty of
027: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
028:
029: You should have received a copy of hipergate License with this code;
030: if not, visit http://www.hipergate.org or mail to info@hipergate.org
031: */
032:
033: package com.knowgate.dataxslt;
034:
035: import org.w3c.dom.Node;
036:
037: import dom.DOMSubDocument;
038:
039: /**
040: * Image element into a Block of a PageSet.
041: *
042: * @author Sergio Montoro Ten
043: * @version 1.0
044: */
045: public class Image extends DOMSubDocument {
046:
047: /**
048: * @param oRefNode DOMDocument Node holding <image> element.
049: */
050:
051: public Image(Node oRefNode) {
052: super (oRefNode);
053: }
054:
055: // ----------------------------------------------------------
056:
057: public String id() {
058: Node oItem = oNode.getAttributes().getNamedItem("id");
059:
060: if (null == oItem)
061: return null;
062: else
063: return oItem.getNodeValue();
064: } // id()
065:
066: // ----------------------------------------------------------
067:
068: public String url() {
069: if (null == getElement("url"))
070: return "";
071: else
072: return getElement("url");
073: } // id()
074:
075: public String path() {
076: if (null == getElement("path"))
077: return "";
078: else
079: return getElement("path");
080: } // id()
081:
082: public String width() {
083: if (null == getElement("width"))
084: return "";
085: else
086: return getElement("width");
087: } // id()
088:
089: public String height() {
090: if (null == getElement("height"))
091: return "";
092: else
093: return getElement("height");
094: } // id()
095:
096: public String alt() {
097: if (null == getElement("alt"))
098: return "";
099: else
100: return getElement("alt");
101: } // id()
102:
103: // ----------------------------------------------------------
104: }
|