XML Validation

Page Index

Introduction

XML that uses the correct syntax, as given by the World Wide Web Consortium (W3C), is Well-Formed XML. XML that is verified against a DTD or schema is Valid XML.

Well-Formed XML

Well-formed XML follows some general rules. More detailed rules can be found at the W3C's recommended XML specifications.

The general syntax of well-formed XML is discussed in the section XML Syntax. These rules are as follows:

Validating with a DTD

A Document Type Definition (DTD) provides the structure for an XML document by listing the legal elements of an XML document, including which names are to be used for different types of elements, where they may occur, and how they all fit together. A DTD can be declared inline in your XML document, or as an external reference. DTD standards are defined by the W3C. The W3C site provides a comprehensive reference of DTDs. You can find more information on DTDs by using the following tutorials:

Validating with a Schema

An XML Schema is an XML-based alternative to DTD. The XML Schema language is also referred to as XML Schema Definition (XSD). Like a DTD, an XML schema describes the structure of an XML document. Schemas use XML syntax and are more powerful and flexible than DTDs. You can find more information on XML Schemas in the following pages:

Validating with RELAX NG

Many people prefer using the RELAX NG validation framework. Developed within OASIS specifications, RELAX NG integrates XML and non-XML syntax, has unrestricted support for unordered and mixed content, and can be used with a separate datatyping language such as w3c XML schema datatypes.

More on RELAX NG


User Contributed Notes
Validating XML
+ Add a comment
  + View comments

Back to top Credits | Glossary | Help | Navigation | Site Map | Site Search