XML File Syntax Rules
<< XML File Syntax
<< XML Tutorials - Herong's Tutorial Notes
This section describes 6 syntax rules of an XML file. A valid and simple XML file is also provided.
Syntax rules of an XML file:
That's it. As I said earlier, XML syntax is very simple.
A valid XML file:
<?xml version="1.0"?> <dictionary> <!-- valid.xml Copyright (c) 2002 by Dr. Herong Yang. http://www.herongyang.com/ --> <note>A valid & simple XML</note> <word> <name is_acronym="true" language="EN">POP</name> <definition>Post Office Protocol</definition> <definition>Point Of Purchase</definition> </word> <word> <update date="2002-12-23"/> <name is_acronym="yes">XML</name> <definition>eXtensible Markup Language</definition> <note>Example: <![CDATA[<?xml version="1.0"?><p>Hello world!</p>]]> </note> </word> <word> <update editor="Herong Yang"/> <name>Markup</name> <definition>The amount added to the cost price to calculate the selling price - <i>Webster</i></definition> </word> </dictionary>
Sections in This Chapter
Types of Information in XML Files
The <?xml ...?> Processing Instruction
dictionary.xml - A Simple XML Sample File