1 28 29 package com.caucho.xml; 30 31 import org.w3c.dom.Node ; 32 import org.w3c.dom.Notation ; 33 34 import java.io.IOException ; 35 36 class QNotation extends QNode implements Notation { 37 String _name; 38 String _publicId; 39 String _systemId; 40 41 QNotation(String name, String publicId, String systemId) 42 { 43 _name = name; 44 _publicId = publicId; 45 _systemId = systemId; 46 } 47 48 public String getNodeName() { return _name; } 49 public String getTagName() { return _name; } 50 public short getNodeType() { return Node.NOTATION_NODE; } 51 52 public String getPublicId() { return _publicId; } 53 public void setPublicId(String arg) { _publicId = arg; } 54 55 public String getSystemId() { return _systemId; } 56 public void setSystemId(String arg) { _systemId = arg; } 57 58 Node importNode(QDocument owner, boolean deep) 59 { 60 QNotation notation = new QNotation(_name, _publicId, _systemId); 61 62 return notation; 63 } 64 65 public void print(XmlPrinter os) throws IOException 66 { 67 os.print("<!NOTATION "); 68 os.print(_name); 69 if (_publicId != null) { 70 os.print(" PUBLIC \""); 71 os.print(_publicId); 72 os.print("\""); 73 if (_systemId != null) { 74 os.print(" \""); 75 os.print(_systemId); 76 os.print("\""); 77 } 78 } else if (_systemId != null) { 79 os.print(" SYSTEM \""); 80 os.print(_systemId); 81 os.print("\""); 82 } 83 os.println(">"); 84 } 85 } 86 | Popular Tags |