XML Tree Architecture

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
JadeXMLAttribute Defines an XML attribute. Attributes are name value pairs associated with elements.
JadeXMLCDATA Defines an XML CDATA section. CDATA sections are used to escape blocks of text containing mark-up characters.
JadeXMLCharacterData Abstract superclass for character data nodes.
JadeXMLComment Defines the content of a comment.
JadeXMLDocument Represents the entire XML document.
JadeXMLDocumentParser Represents the interface for parsing XML documents into a tree of objects.
JadeXMLDocumentType Defines an XML DOCTYPE declaration.
JadeXMLElement Represents an XML element. Elements are the fundamental units of XML.
JadeXMLNode Abstract superclass of all nodes in the tree.
JadeXMLProcessingInstruction Defines an XML processing instruction. Processing instructions tell applications how they should handle a document after it has been parsed.
JadeXMLText 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.

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 JadeXMLText nodes.