XML Tutorials - Herong's Tutorial Examples - v5.25, by Herong Yang
XML File Syntax Rules
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-2018 HerongYang.com. All Rights Reserved. --> <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>
Table of Contents
Introduction of XML (eXtensible Markup Language)
Types of Information in XML Files
The <?xml ...?> Processing Instruction
dictionary.xml - A Simple XML Sample File
DOM (Document Object Model) Programming Interface
SAX (Simple API for XML) Programming Interface
DTD (Document Type Definition) Introduction
Validating an XML Document against the Specified DTD Document Type
XSD (XML Schema Definition) Introduction
Validating XML Documents Against Specified XML Schemas
XSL (Extensible Stylesheet Language) Introduction
XSLT (XSL Transformations) Introduction
XSLT Elements as Programming Statements
Control and Generate XML Element in the Result
PHP Extensions for XML Manipulation
Processing XML with Python Scripts
XML Tools Plugin for Notepad++
XML Plugin Packages for Atom Editor