: Class Node
com.exploringxml.xml
Class Node
java.lang.Object
|
+--com.exploringxml.xml.Node
- public class Node
- extends java.lang.Object
A node of an XML DOM tree;
|
Constructor Summary |
Node()
|
|
Method Summary |
(package private) static Node |
createChardata()
factory method for chardata nodes |
(package private) static Node |
createComment()
factory method for comment nodes |
(package private) static Node |
createElement()
factory method for element nodes |
(package private) static Node |
createPi()
factory method for PI nodes |
(package private) static Node |
createRootelement()
factory method for the root element |
Node |
find(java.lang.String path,
int occur)
find the node matching a certain occurance of the path description |
(package private) Node |
findChildElement(Node parent,
java.lang.String simplePath,
int occur)
find the child node matching a certain occurance of a simple path description |
java.lang.String |
getCharacters()
returns the character data in the first child element;
returns nonsense if the first child element ist not chardata |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
type
public java.lang.String type
name
public java.lang.String name
value
public java.lang.String value
attributes
public java.util.Hashtable attributes
uid
public int uid
contents
public JSArray contents
index
public JSArray index
Element
static final java.lang.String Element
CharData
static final java.lang.String CharData
PI
static final java.lang.String PI
Comment
static final java.lang.String Comment
Node
public Node()
createElement
static Node createElement()
- factory method for element nodes
- Returns:
- a Node of type element
createRootelement
static Node createRootelement()
- factory method for the root element
- Returns:
- a rootelement Node
createChardata
static Node createChardata()
- factory method for chardata nodes
- Returns:
- a chardata Node
createPi
static Node createPi()
- factory method for PI nodes
- Returns:
- a PI Node
createComment
static Node createComment()
- factory method for comment nodes
- Returns:
- a comment Node
getCharacters
public java.lang.String getCharacters()
- returns the character data in the first child element;
returns nonsense if the first child element ist not chardata
- Returns:
- the characters following an element
find
public Node find(java.lang.String path,
int occur)
- find the node matching a certain occurance of the path description
- Parameters:
path - an XPath style expression without leading slashoccur - the n'th occurance of a node matching the path expression- Returns:
- the n'th Node matching the path description
findChildElement
Node findChildElement(Node parent,
java.lang.String simplePath,
int occur)
- find the child node matching a certain occurance of a simple path description
- Parameters:
parent - the parent node to start fromsimplePath - one element of an XPath style expressionoccur - the n'th occurance of a node matching the path expression- Returns:
- the n'th child Node matching the simple path description