The JADE XML Tree model reads an XML document from a file or string and builds a tree of objects representing that document.
Your applications can then navigate the tree, extract information from the document, manipulate the tree, and write it into an XML file or string, as shown in the following diagram.
The following diagram shows the JADE XML Tree class hierarchy.
The classes in the JADE XML Tree model are listed in the following table.
Class | Description |
---|---|
|
Defines an XML attribute. Attributes are name value pairs associated with elements. |
|
Defines an XML CDATA section. CDATA sections are used to escape blocks of text containing mark-up characters. |
|
Abstract superclass for character data nodes. |
|
Defines the content of a comment. |
|
Represents the entire XML document. |
|
Represents the interface for parsing XML documents into a tree of objects. |
|
Defines an XML DOCTYPE declaration. |
|
Represents an XML element. Elements are the fundamental units of XML. |
|
Abstract superclass of all nodes in the tree. |
|
Defines an XML processing instruction. Processing instructions tell applications how they should handle a document after it has been parsed. |
|
Represents character-based content in the document. |
For a summary of the properties and methods defined in these classes, if applicable, see "JADE XML Classes", later in this chapter.
A JADE XML Tree document is structured as follows.
Each XML document has a single
Each
Each
Each parent node has zero or more child nodes.
The following diagram shows the primary relationships used to model the tree structure.
The following object diagram shows the tree of nodes that make up the example library XML file.
In this example, the text data is stored directly in the element object, which improves performance. However, for elements that contain mixed content (that is, both elements and text), the text is always stored in separate child