| Contents | Package | Class | Tree | Deprecated | Index | Help | XML for Java | ||
| PREV | NEXT | SHOW LISTS | HIDE LISTS | ||
java.lang.Object
|
+----com.ibm.xml.parser.Child
|
+----com.ibm.xml.parser.PseudoNode
PseudoNodes can be added to TXDocument, TXElement, or DTD objects in order to expediently print text.
For example, instead of specifying an Element hierarchy as:
TXElement root = factory.createElement("PERSON");
TXElement item = factory.createElement("NAME"); // Make <NAME>John Doe</NAME>
item.addElement(factory.createText("John Doe"));
root.addElement(item);
item = factory.createElement("AGE"); // Make <AGE>35</AGE>
item.addElement(factory.createText("35"));
root.addElement(item);
item = factory.createElement("EMAIL"); // Make <EMAIL>John.Doe@foo.com</EMAIL>
item.addElement(factory.createText("John.Doe@foo.com"));
root.addElement(item); // Now root has NAME, AGE, and EMAIL.
doc.addElement(root);
...using PsuedoNode you can instead specify:
doc.addElement(new PseudoNode("<PERSON><NAME>John Doe</NAME><AGE>35</AGE><EMAIL>John.Doe@foo.com</EMAIL></PERSON>"));
Note that because of the requirement for validation, the object tree produced by the XML4J parser doesn't include PseudoNodes.
| Fields inherited from class com.ibm.xml.parser.Child |
| ATTDEF, ATTLIST, DOCUMENTTYPE, ELEMENTDEFINITION, ENTITY, GENERALREFERENCE, NOTATION, PSEUDONODE |
| Constructor Summary | |
| PseudoNode(java.lang.String data)
|
|
| Method Summary | |
| java.lang.Object | clone()
|
| java.lang.String | getData()
|
| int | getNodeType()
|
| java.lang.String | getText()
|
| void | setData(java.lang.String data)
|
| Methods inherited from class com.ibm.xml.parser.Child |
| clearDigest, clone, getChildNodes, getDigest, getFactory, getFirstChild, getNextSibling, getParentNode, getPreviousSibling, getText, hasChildNodes, insertBefore, makeXPointer, print, print, removeChild, replaceChild, searchAncestors, searchAncestors, setFactory, toString, toString |
| Methods inherited from class java.lang.Object |
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PseudoNode(java.lang.String data)
data
- The actual content of the Pseudo Node.
| Method Detail |
public java.lang.Object clone()
This method is defined by Child.
public int getNodeType()
This method is defined by DOM.
public java.lang.String getData()
public void setData(java.lang.String data)
data
- The actual content of this Pseudo Node.
public java.lang.String getText()
This method is defined by Child.
| Contents | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV | NEXT | SHOW LISTS | HIDE LISTS | ||