Pages

Points to Remember about xml

Important points concerning xml.

1. First line of xml document should be
   <?xml version="1.0" encoding="utf-8" ?> this is the xml declaration known as "prolog" This shows  the version and encoding about xml document.

2. xml document must have root element, and all other node are child element.

    <employee>
      <emp1>xyz</emp1>
      <emp1>abc</emp1>
   </employee>

3. All xml elements must have closing tag.

    <emp1>xyz</emp1>
    </ > referred to as closing tag

4. xml tags(opening and closing tag) are case sensitive

    <emp1>xyz</Emp> incorrect
    <emp1>xyz</emp1> correct

5. xml attribute value must be quoted

    <emp1 id="101">xyz</emp1> right
    <emp1 id=101>xyz</emp1> wrong.
6. xml have not any predefined tag. user define our own tag.

7. xml elements must be properly nested

8. white space is preserved in xml

9. meta-characters(special characters in xml) in xml

    <, > , </

 do not use these character directly in your xml document because these character
 are the meta-character for xml.

use these &lt; , &gt; instead of <, >

10. xml can be used to store data

11. xml can be used to exchange data

12. Comments in xml

<!-- This is comment -->