xsd

Getting started with xsd

Remarks#

XML Schema is a language and framework for validating XML documents.

An XML document that is well-formed, in the sense that it is syntactically conformant to the XML specification, can be tested for validity against a schema. The distinction between well-formedness, which is absolute, and validity, which is relative to a schema, is paramount.

Validation encompasses:

  • Checking whether the XML document fulfils additional requirements such as the elements having certain names, restrictions on the content of elements, consistency constraints (primary keys, uniqueness, etc), attribute values or text matching certain types.
  • Upon success, conversion of the input data model instance (called XML Infoset) to an output instance (PSVI: Post-Schema-Validation Infoset), where elements and attributes are annotated with type information, where default values have been populated, etc.

XML Schema was introduced to address requirements that DTD validation failed to address, among others a more complete type system including a rich set of builtin types, type restriction and extension capabilities, and more control on the restriction of element layout.

Versions#

VersionRelease Date
1.02001-05-02
1.0, Second Edition2004-10-28
1.12012-04-05

XML Schema 1.0 was approved as a W3C Recommendation in May 2001, and the second edition incorporating errata was published as a W3C Recommendation several years later.

XML Schema 1.1 became a W3C Recommendation in 2012, which fixed more bugs and added other improvements, while being mostly compatible with earlier versions.

Installation or Setup

XSD, XML Schema Definition, is a language which describes the structure of XML documents. XSD files can be used to validate an XML file. The process of doing this will depend on what you choose to implement it with. Care should be taken to ensure the validation engine you use is compatible with the desired version of XSD.


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow