XML documents must contain the root element. This element is the parent element of all other elements.
The elements in an XML document form a document tree. The tree starts at the root and expands to the very bottom of the tree.
All elements can have child elements:
<root> <child> <subchild>.....</subchild> </child> </root>
The above image represents a book in the following XML:
<bookstore> <book category="COOKING"> <title lang="en">Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> <price>30.00</price> </book> <book category="CHILDREN"> <title lang="en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> <book category="WEB"> <title lang="en">Learning XML</title> <author>Erik T. Ray</author> <year>2003</year> <price>39.95</price> </book> </bookstore>
In the example The root element is
The
The above is the content of xml learning (2) xml document tree structure diagram. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!