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) 2014, 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

 About This Book

 Introduction of XML (eXtensible Markup Language)

XML File Syntax

 Types of Information in XML Files

XML File Syntax Rules

 The <?xml ...?> Processing Instruction

 dictionary.xml - A Simple XML Sample File

 XML File Browsers

 DOM (Document Object Model) Programming Interface

 SAX (Simple API for XML) Programming Interface

 DTD (Document Type Definition) Introduction

 Syntaxes of DTD Statements

 Validating an XML Document against the Specified DTD Document Type

 XSD (XML Schema Definition) Introduction

 Syntaxes of XSD Statements

 Validating XML Documents Against Specified XML Schemas

 XSL (Extensible Stylesheet Language) Introduction

 XSLT (XSL Transformations) Introduction

 Java Implementation of XSLT

 XPath (XML Path) Language

 XSLT Elements as Programming Statements

 Control and Generate XML Element in the Result

 XML Notepad - XML Editor

 XML Tools Plugin for Notepad++

 XML 1.1 Changes and Parsing Examples

 Outdated Tutorials

 References

 PDF Printing Version