A.2 Well-Formed XML

 <  Day Day Up  >  

A.2 Well- Formed XML

For an XML document to be considered valid, it must satisfy the following restrictions:

  • The document must have only one top-level element. This element is called the root element .

  • Every element must have both a start and an end tag.

  • All attributes must have values, and those values must be quoted.

  • Elements must not overlap. You cannot use <a><b></a></b> , because the ending </a> tag comes before </b> .

  • You must convert &, <, and > to their entity equivalents. You can use htmlentities( ) to solve this.

When a document meets these rules, it's valid, or well-formed , XML.

 <  Day Day Up  >  


Upgrading to PHP 5
Upgrading to PHP 5
ISBN: 0596006365
EAN: 2147483647
Year: 2004
Pages: 144

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net