Rule
|
Wrong
|
Right
|
XML document should be well formed,
end tag must have the same name as the start tag.
|
<contact-detail> <name> Aakash </contact-detail> </name>
|
<contact-detail> <name> Aakash
</name> </contact-detail>
|
XML Document must be only one root element.
|
<contact-detail1> <name> Aakash Rathore </name> </contact-detail1> <contact-detail2> <name> Naresh Kumar </name> </contact-detail2>
|
<contact-detail> <name> Aakash Rathore </name> <name> Naresh Kumar </name> </contact-detail>
|
XML is case sensitive, so be aware about the name of tags. It will generate parser error because name and NAME are different.
|
<name> Aakash Rathore </contact-detail> </NAME>
|
<name> Aakash Rathore </contact-detail> </name>
|
XML attribute value must be quoted.Date is an attribute of XML element <contact-detail>
|
<contact-detail date=02/05/2012> <name> Aakash Rathore </name> <company> ABC Ltd. </company> <phone> 234567 </phone> </contact-detail>
|
<contact-detail date=”02/05/2012”> <name> Aakash Rathore </name> <company> ABC Ltd. </company> <phone> 234567 </phone> </contact-detail>
|