Write some basic rules of XML?

Write some basic rules of XML?

 I think their is no problem comes when we using XML rules.Because XML has no pre-defined tags.so, it can easy implement and made logical arranged data.Some basic rules of XML given below.Keep in mind when you creating any XML document.

Rule1: ALL tags that you open should have been closed.Like:<Welcome>......</Welcome>

Rule2:XML Tags are Case-Sensitive.So,if you create tag like:<Welcome> than you can\'t closed this tag with </welcome>.You should write </Welcome>.

Rule3:XML element should be properly nested.

Example:<R4R><Welcome>.......</R4R></Welcome>

is false.

<R4R><Welcome>.......</Welcome></R4R>

Rule4:Document should have a root node.

<root>

  <child>

    <subchild>.....</subchild>

  </child>

</root> 

Rule5:We should the attribute values.

<note date=\"03/02/2008\">

<to>abhi</to>

<from>vivek</from>

</note>   


By:Vivek
Date:2014-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related XML Subjective Links

XML Subjective interview questions and answers for experienced and fresher