Validation Overview
A schema defines the structure of XML documents. It provides details about the content model: which elements it contains and in what order, what its content can be, and which content these attributes can contain.
A schema verifies that the incoming XML documents are in the expected format.
An XML schema can be used to:
- Validate the content of an XML document.
- Determine whether the XML document is a valid instance of the vocabulary (grammar or rules) expressed by the XML schema.
- Describe the vocabulary for use by others creating XML documents.
- Define the elements that can appear within an XML document and the attributes that can be associated with an element.
- Define whether an element is empty or can include text.
- Define a default value for an attribute.
- Define elements that can contain child elements.
- Define the sequence for child elements that appear in an element.
- Define the number of child elements.
Writing validation rules
The following can be used to write validation rules.
- Document Type Definition (DTD)
- XML-Data Reduced (XDR) schema
- XML Schema definition language (XSD) schema
See Also
Frequently Asked Questions about Schemas | Comparing Schema Languages | DTD Developer's Guide | DTD Reference | XML Schema Elements