A XML document is consist of tags and data. All data in an XML document is wrapped
by the tags.
Here is the example:
The first line is the XML declaration. It defines the XML version (1.0) and the character set (ISO-8859).
The next line uses tag "<customer>". It is the root element of the document.
The next four lines describe the child elements () of the root.
Please note that, except the first line, all tags in the document are used in pair: opening tag and closing tag.
you can assume the structure of an XML file as a "tree" that starts at the root tag "student" and branches to the leaves tags "firstname", "lastname", "gender", "address", "phone" and "email".
Please note, an XML document must contain a pair of root tags for the "parent" element, whcih contains all other elements. You cannot have two roots in a single XML document. All elements can have child elements.
Here is the example:
<?xml version="1.0" encoding="ISO-8859-1"?>
<student>
<firstname>Mahi</firstname>
<lastname>Babariya</lastname>
<gender>male</gender>
<address>
<street>147, Parle point</street>
<city>Surat</city>
<state>Gujarat</state>
<zip>395007</zip>
<country>India</country>
</student></address><phone>99887766555</phone>
<email>mahi@yahoo.com</email>
The first line is the XML declaration. It defines the XML version (1.0) and the character set (ISO-8859).
The next line uses tag "<customer>". It is the root element of the document.
The next four lines describe the child elements () of the root.
Please note that, except the first line, all tags in the document are used in pair: opening tag and closing tag.
you can assume the structure of an XML file as a "tree" that starts at the root tag "student" and branches to the leaves tags "firstname", "lastname", "gender", "address", "phone" and "email".
Please note, an XML document must contain a pair of root tags for the "parent" element, whcih contains all other elements. You cannot have two roots in a single XML document. All elements can have child elements.
No comments:
Post a Comment