JadeXMLNode Class

The JadeXMLNode class is the abstract superclass of all nodes in an XML document tree. A node has an owning document and it can have child nodes and a parent node. A node can be copied, moved, or removed, and it can have its XML representation output. If you know the names of specific elements in the tree, you can retrieve them using the methods defined in the JadeXMLDocument and JadeXMLElement classes. For example, the JadeXMLDocument::getElementsByTagName method retrieves all elements in the document with a specified name, and the JadeXMLElement::getElementByTagName method returns the first child element that matches a specified name.

The properties defined in the JadeXMLNode class are summarized in the following table.

Property Contains…
childNodes Array of children of the node
document Owning document of the node
parentNode Parent of the node

The methods defined in the JadeXMLNode class are summarized in the following table.

Method Description
copyAfter Copies the node and inserts it after the specified node
copyAsChildOf Copies the node and inserts it as a child of the specified node
copyBefore Copies the node and inserts it before the specified node
descendsFrom Determines whether the specified XML node is an ancestor of the receiver JadeXMLNode class
moveAfter Moves the node to the position after the specified node
moveAsChildOf Moves the node to the position as a child of the specified node
moveBefore Moves the node to the position before the specified node
remove Removes the node from the XML tree and then deletes the node
writeToString Writes the node to a string

For details, see "JadeXMLNode Class", in Chapter 1 of the JADE Encyclopaedia of Classes.