Wednesday, November 3, 2010

XML Document Structure

XML Documents are composed of set of "entities", that are identified by unique names. All documents begin with a "root" or document entity. All other entities are optional.

XML Documents have a logical structure. Logically, documents are composed of declarations, elements, comments, character references, and processing instructions, all of which are indicated in the document by explicit markup.

XML Declaration is included as the first line in the document. It defines the XML Version of the document. In this case the document is of 1.0 version.

XML groups information in hierarchies. The items in the document relate to each other in parent/child and sibling/ sibling relationship.

Root element: First element of the document is called Root element. This element is the "the parent" of all other elements.

XML Tree starts at the root and branches to the lowest level of the test.

<root>
<child>
<subchild>...</subchild>
</child>
</root>

The terms parent, child and sibling are used to describe the relationship between elements. Parent elements have children. Children on the same level are called siblings (brothers or sisters).


All XML documents must have a root tag.

XML structure is called tree, and any parts of the tree that contain children are called branches, while parts that have no children are called leaves.

No comments:

Post a Comment