Xml
XML element
XML elements are extensible and associated with each other. The naming rules for XML elements are simple.
XML elements are extensible
XML documents can be extended to carry more information. Take a look at the following XML note example:
< note>
< to>tove</to>
< from>jani</from>
< Body>don ' t forget me this weekend!</body>
</note>
Imagine that we created an application that extracts the < to>, < from>, and < body> elements from an XML document and generates such output:
Message
To:tove
From:jani
Don ' t forget me this weekend!
If the author of this XML document adds some additional information to it:
< note>
< date>1999-08-01</date>
< to>tove</to>
< from>jani</from>
< heading>reminder< Body>don ' t forget me this weekend!</body>
</note>
So will this application fail? No, the application will still generate the same output from the XML document by finding the < To>, < from>, and < body> elements. XML documents can be extended.
XML elements are associated with each other
The relationship between them is like the relationship between parents and children. To understand the terms of XML, you must know the relationship between the naming of XML elements and the description of XML elements. Here is a description of the book:
Book Title:my-I XML
Chapter 1:introduction to XML
What is HTML
What is XML
Chapter 2:xml Syntax
Elements must have a closing tag
Elements must be correctly nested
The following XML document describes the book:
< book>
< title>my-xml</title>
< prod id= "33-657" media= "paper" ></prod>
< Chapter>introduction to XML
< Para>what is html</para>
< Para>what is xml</para>
</chapter>
< Chapter>xml Syntax
< para>elements must have a closing tag</para>
< para>elements must be properly nested</para>
</chapter>
</book>
Here, the book is the root element, and title and chapter (title and chapter) are the child elements of books. Book is the parent element of title and chapter. Title and chapter are sibling elements (or sister elements) because their parents are the same.