Tuesday, February 4, 2014

Formate and Structure of XML(2).

XML documents must contain one element that is the parent of all other elements. This element is called the root element.


Syntax:

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


XML elements can have attributes in name/value pairs just like in HTML. But in XML the attribute value must always be quoted.

For ex:-
1) this one create erore.
 
<info birthday=05/01/1991>
<firstname>Mahi</firstname>
<lastname>Babariya</lastname>
</customer> 


2) this one is right 


<info birthday="05/01/1991">
<firstname>Mahi</firstname>
<lastname>Babariya</lastname>
</customer>

No comments:

Post a Comment