XML Schema
An XML schema is a description of a type of XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic syntactical constraints imposed by XML itself. These constraints are generally expressed using some combination of grammatical rules governing the order of elements, Boolean predicates that the content must satisfy, data types governing the content of elements and attributes, and more specialized rules such as uniqueness and referential integrity constraints. There are languages developed specifically to express XML schemas. The document type definition (DTD) language, which is native to the XML specification, is a schema language that is of relatively limited capability, but that also has other uses in XML aside from the expression of schemas. Two more expressive XML schema languages in widespread use are XML Schema (with a capital S) and RELAX NG. The mechanism for associating an XML document with a schema varies according to the schema language. The association may be achieved via markup within the XML document itself, or via some external means. The XML Schema Definition is commonly referred to as XSD.
An XML schema is a description of a type of XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic syntactical constraints imposed by XML itself. These constraints are generally expressed using some combination of grammatical rules governing the order of elements, Boolean predicates that the content must satisfy, data types governing the content of elements and attributes, and more specialized rules such as uniqueness and referential integrity constraints. There are languages developed specifically to express XML schemas. The document type definition (DTD) language, which is native to the XML specification, is a schema language that is of relatively limited capability, but that also has other uses in XML aside from the expression of schemas. Two more expressive XML schema languages in widespread use are XML Schema (with a capital S) and RELAX NG. The mechanism for associating an XML document with a schema varies according to the schema language. The association may be achieved via markup within the XML document itself, or via some external means. The XML Schema Definition is commonly referred to as XSD. ==Languages== There are several different languages available for specifying an XML schema. Each language has its strengths and weaknesses. The primary purpose of a schema language is to specify what the structure of an XML document can be. This means which elements can reside in which other elements, which attributes are and are not legal to have on a particular element, and so forth. A schema is analogous to a grammar for a language; a schema defines what the vocabulary for the language may be and what a valid "sentence" is. There are historic and current XML schema languages: The main ones (see also the ISO 19757's endorsed languages) are described below. Though there are a number of schema languages available, the primary three languages are Document Type Definitions, W3C XML Schema, and RELAX NG. Each language has its own advantages and disadvantages. When the validator encounters something that matches the "odd" pattern, it is unknown whether this is the optional last "odd" reference or simply one in the zeroOrMore sequence without looking ahead at the data. RELAX NG allows this kind of specification. W3C XML Schema requires all of its sequences to be fully deterministic, so mechanisms like the above must be either specified in a different way or omitted altogether. RELAX NG allows attributes to be treated as elements in content models. In particular, this means that one can provide the following: false true This block states that the element "some_element" must have an attribute named "has_name". This attribute can only take true or false as values, and if it is true, the first child element of the element must be "name", which stores text. If "name" did not need to be the first element, then the choice could be wrapped in an "interleave" element along with other elements. The order of the specification of attributes in RELAX NG has no meaning, so this block need not be the first block in the element definition. W3C XML Schema cannot specify such a dependency between the content of an attribute and child elements. RELAX NG's specification only lists two built-in types (string and token), but it allows for the definition of many more. In theory, the lack of a specific list allows a processor to support data types that are very problem-domain specific. Most RELAX NG schemas can be algorithmically converted into W3C XML Schemas and even DTDs (except when using RELAX NG features not supported by those languages, as above). The reverse is not true. As such, RELAX NG can be used as a normative version of the schema, and the user can convert it to other forms for tools that do not support RELAX NG. ==References== Comparative Analysis of Six XML Schema Languages by Dongwon Lee, Wesley W. Chu, In ACM SIGMOD Record, Vol. 29, No. 3, page 76-87, September 2000 Taxonomy of XML Schema Languages using Formal Language Theory by Makoto Murata, Dongwon Lee, Murali Mani, Kohsuke Kawaguchi, In ACM Trans. on Internet Technology (TOIT), Vol. 5, No. 4, page 1-45, November 2005 ==External links== Comparing XML Schema Languages by Eric van der Vlist (2001) Application of XML Schema in Web Services Security by Sridhar Guthula, W3C Schema Experience Report, May 2005 March 2009 DEVX article "Taking XML Validation to the Next Level: Introducing CAM" by Michael Sorens
References
- XML Schema Part 1: Structures Second Edition · retrieved 2025-11-12 · rev 1375801575
Cite this reference
MLA "XML Schema Part 1: Structures Second Edition." 2025-11-12. https://www.w3.org/TR/xmlschema-1/structures.html. Accessed 24 November 2026.
Chicago "XML Schema Part 1: Structures Second Edition." 2025-11-12. https://www.w3.org/TR/xmlschema-1/structures.html.
APA encyclopegia.org. (2025). XML Schema Part 1: Structures Second Edition. Retrieved November 24, 2026, from https://www.w3.org/TR/xmlschema-1/structures.html
- CLiX Language Specification Version 1.0 · retrieved 2026-11-19 · rev 1375801575
Cite this reference
MLA "CLiX Language Specification Version 1.0." Marconi, Michael; Nentwich, Christian, eds. 2026-11-19. https://web.archive.org/web/20150109152851/http://www.clixml.info/clix/1.0/. Accessed 24 November 2026.
Chicago "CLiX Language Specification Version 1.0." Marconi, Michael; Nentwich, Christian, eds. 2026-11-19. https://web.archive.org/web/20150109152851/http://www.clixml.info/clix/1.0/.
APA Marconi, Michael; Nentwich, Christian, eds. (2026). CLiX Language Specification Version 1.0. Retrieved November 24, 2026, from https://web.archive.org/web/20150109152851/http://www.clixml.info/clix/1.0/
- Namespace Routing Language (NRL) · retrieved 2026-11-19 · rev 1375801575
Cite this reference
MLA "Namespace Routing Language (NRL)." Clark, James (13 June 2003). 2026-11-19. http://thaiopensource.com/relaxng/nrl.html. Accessed 24 November 2026.
Chicago "Namespace Routing Language (NRL)." Clark, James (13 June 2003). 2026-11-19. http://thaiopensource.com/relaxng/nrl.html.
APA Clark, James (13 June 2003). (2026). Namespace Routing Language (NRL). Retrieved November 24, 2026, from http://thaiopensource.com/relaxng/nrl.html
- RELAX NG Specification · retrieved 2026-11-19 · rev 1375801575
Cite this reference
MLA "RELAX NG Specification." Clark, James; Makoto, MURATA, eds. 2026-11-19. https://www.oasis-open.org/committees/relax-ng/spec-20011203.html. Accessed 24 November 2026.
Chicago "RELAX NG Specification." Clark, James; Makoto, MURATA, eds. 2026-11-19. https://www.oasis-open.org/committees/relax-ng/spec-20011203.html.
APA Clark, James; Makoto, MURATA, eds. (2026). RELAX NG Specification. Retrieved November 24, 2026, from https://www.oasis-open.org/committees/relax-ng/spec-20011203.html
- RELAX NG Compact Syntax · retrieved 2026-11-19 · rev 1375801575
Cite this reference
MLA "RELAX NG Compact Syntax." Clark, James, ed. 2026-11-19. https://www.oasis-open.org/committees/relax-ng/compact-20021121.html. Accessed 24 November 2026.
Chicago "RELAX NG Compact Syntax." Clark, James, ed. 2026-11-19. https://www.oasis-open.org/committees/relax-ng/compact-20021121.html.
APA Clark, James, ed. (2026). RELAX NG Compact Syntax. Retrieved November 24, 2026, from https://www.oasis-open.org/committees/relax-ng/compact-20021121.html
- While annotations in RELAX NG can support default attribute values, the RELAX NG specification does not mandate that a validator provide this ability to modify an XML infoset as part of validation. The WXS specification does mandate this behavior. An additional specification associated with RELAX NG does provide this ability. See Relax NG DTD Compatibility (default value) . Wikipedia revision 1375801575, retrieved 2026-11-20 · retrieved 2026-11-19 · rev 1375801575
Cite this reference
MLA "While annotations in RELAX NG can support default attribute values, the RELAX NG specification does not mandate that a validator provide this ability to modify an XML infoset as part of validation. The WXS specification does mandate this behavior. An additional specification associated with RELAX NG does provide this ability. See Relax NG DTD Compatibility (default value) . Wikipedia revision 1375801575, retrieved 2026-11-20." While annotations in RELAX NG can support default attribute values, the RELAX NG specification does not mandate that a v. 2026-11-19. http://www.oasis-open.org/committees/relax-ng/compatibility.html#default-value. Accessed 24 November 2026.
Chicago "While annotations in RELAX NG can support default attribute values, the RELAX NG specification does not mandate that a validator provide this ability to modify an XML infoset as part of validation. The WXS specification does mandate this behavior. An additional specification associated with RELAX NG does provide this ability. See Relax NG DTD Compatibility (default value) . Wikipedia revision 1375801575, retrieved 2026-11-20." While annotations in RELAX NG can support default attribute values, the RELAX NG specification does not mandate that a v. 2026-11-19. http://www.oasis-open.org/committees/relax-ng/compatibility.html#default-value.
APA While annotations in RELAX NG can support default attribute values, the RELAX NG specification does not mandate that a v. (2026). While annotations in RELAX NG can support default attribute values, the RELAX NG specification does not mandate that a validator provide this ability to modify an XML infoset as part of validation. The WXS specification does mandate this behavior. An additional specification associated with RELAX NG does provide this ability. See Relax NG DTD Compatibility (default value) . Wikipedia revision 1375801575, retrieved 2026-11-20. Retrieved November 24, 2026, from http://www.oasis-open.org/committees/relax-ng/compatibility.html#default-value
- DeRose, Steven. (1997). The SGML FAQ Book: Understanding the Foundation of HTML and XML . Kluwer Academic Publishers. ISBN 978-0792399438 . Wikipedia revision 1375801575, retrieved 2026-11-20 · retrieved 2026-11-19 · rev 1375801575
Cite this reference
MLA "DeRose, Steven. (1997). The SGML FAQ Book: Understanding the Foundation of HTML and XML . Kluwer Academic Publishers. ISBN 978-0792399438 . Wikipedia revision 1375801575, retrieved 2026-11-20." DeRose, Steven. 2026-11-19. https://en.wikipedia.org/wiki/ISBN_(identifier). Accessed 24 November 2026.
Chicago "DeRose, Steven. (1997). The SGML FAQ Book: Understanding the Foundation of HTML and XML . Kluwer Academic Publishers. ISBN 978-0792399438 . Wikipedia revision 1375801575, retrieved 2026-11-20." DeRose, Steven. 2026-11-19. https://en.wikipedia.org/wiki/ISBN_(identifier).
APA DeRose, Steven. (2026). DeRose, Steven. (1997). The SGML FAQ Book: Understanding the Foundation of HTML and XML . Kluwer Academic Publishers. ISBN 978-0792399438 . Wikipedia revision 1375801575, retrieved 2026-11-20. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/ISBN_(identifier)
- Eve Maler and Jeanne El Andaloussi (1995). Developing SGML DTDs: From Text to Model to Markup . Prentice Hall PTR. ISBN 978-0133098815 . Wikipedia revision 1375801575, retrieved 2026-11-20 · retrieved 2026-11-19 · rev 1375801575
Cite this reference
MLA "Eve Maler and Jeanne El Andaloussi (1995). Developing SGML DTDs: From Text to Model to Markup . Prentice Hall PTR. ISBN 978-0133098815 . Wikipedia revision 1375801575, retrieved 2026-11-20." Eve Maler and Jeanne El Andaloussi (1995). 2026-11-19. https://en.wikipedia.org/wiki/ISBN_(identifier). Accessed 24 November 2026.
Chicago "Eve Maler and Jeanne El Andaloussi (1995). Developing SGML DTDs: From Text to Model to Markup . Prentice Hall PTR. ISBN 978-0133098815 . Wikipedia revision 1375801575, retrieved 2026-11-20." Eve Maler and Jeanne El Andaloussi (1995). 2026-11-19. https://en.wikipedia.org/wiki/ISBN_(identifier).
APA Eve Maler and Jeanne El Andaloussi (1995). (2026). Eve Maler and Jeanne El Andaloussi (1995). Developing SGML DTDs: From Text to Model to Markup . Prentice Hall PTR. ISBN 978-0133098815 . Wikipedia revision 1375801575, retrieved 2026-11-20. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/ISBN_(identifier)
- James Clark (co-creator of RELAX NG). RELAX NG and W3C XML Schema Archived September 27, 2007, at the Wayback Machine Wikipedia revision 1375801575, retrieved 2026-11-20 · retrieved 2026-11-19 · rev 1375801575
Cite this reference
MLA "James Clark (co-creator of RELAX NG). RELAX NG and W3C XML Schema Archived September 27, 2007, at the Wayback Machine Wikipedia revision 1375801575, retrieved 2026-11-20." James Clark (co-creator of RELAX NG). 2026-11-19. http://www.imc.org/ietf-xml-use/mail-archive/msg00217.html. Accessed 24 November 2026.
Chicago "James Clark (co-creator of RELAX NG). RELAX NG and W3C XML Schema Archived September 27, 2007, at the Wayback Machine Wikipedia revision 1375801575, retrieved 2026-11-20." James Clark (co-creator of RELAX NG). 2026-11-19. http://www.imc.org/ietf-xml-use/mail-archive/msg00217.html.
APA James Clark (co-creator of RELAX NG). (2026). James Clark (co-creator of RELAX NG). RELAX NG and W3C XML Schema Archived September 27, 2007, at the Wayback Machine Wikipedia revision 1375801575, retrieved 2026-11-20. Retrieved November 24, 2026, from http://www.imc.org/ietf-xml-use/mail-archive/msg00217.html
- Document Content Description for XML: Submission to the World Wide Web Consortium · retrieved 2026-11-19 · rev 1375801575
Cite this reference
MLA "Document Content Description for XML: Submission to the World Wide Web Consortium." Bray, Tim; Frankston, Charles; Malhotra, Ashok, eds. 2026-11-19. http://www.w3.org/TR/NOTE-dcd. Accessed 24 November 2026.
Chicago "Document Content Description for XML: Submission to the World Wide Web Consortium." Bray, Tim; Frankston, Charles; Malhotra, Ashok, eds. 2026-11-19. http://www.w3.org/TR/NOTE-dcd.
APA Bray, Tim; Frankston, Charles; Malhotra, Ashok, eds. (2026). Document Content Description for XML: Submission to the World Wide Web Consortium. Retrieved November 24, 2026, from http://www.w3.org/TR/NOTE-dcd
- Freely Available Standards · retrieved 2026-11-19 · rev 1375801575
Cite this reference
MLA "Freely Available Standards." a b "Freely Available Standards". 2026-11-19. http://standards.iso.org/ittf/PubliclyAvailableStandards/index.html. Accessed 24 November 2026.
Chicago "Freely Available Standards." a b "Freely Available Standards". 2026-11-19. http://standards.iso.org/ittf/PubliclyAvailableStandards/index.html.
APA a b "Freely Available Standards". (2026). Freely Available Standards. Retrieved November 24, 2026, from http://standards.iso.org/ittf/PubliclyAvailableStandards/index.html
- Standards and projects under the direct responsibility of ISO/IEC JTC 1/SC 34 Secretariat · retrieved 2026-11-19 · rev 1375801575
Cite this reference
MLA "Standards and projects under the direct responsibility of ISO/IEC JTC 1/SC 34 Secretariat." a b c "Standards and projects under the direct responsibility of ISO/IEC JTC 1/SC 34 Secretariat". 2026-11-19. http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_tc_browse.htm?commid=45374&published=on. Accessed 24 November 2026.
Chicago "Standards and projects under the direct responsibility of ISO/IEC JTC 1/SC 34 Secretariat." a b c "Standards and projects under the direct responsibility of ISO/IEC JTC 1/SC 34 Secretariat". 2026-11-19. http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_tc_browse.htm?commid=45374&published=on.
APA a b c "Standards and projects under the direct responsibility of ISO/IEC JTC 1/SC 34 Secretariat". (2026). Standards and projects under the direct responsibility of ISO/IEC JTC 1/SC 34 Secretariat. Retrieved November 24, 2026, from http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_tc_browse.htm?commid=45374&published=on
- XML Schema · retrieved 2026-11-23 · rev 1375801575
Cite this reference
MLA "XML Schema." 2026-11-23. https://en.wikipedia.org/w/index.php?oldid=1375801575. Accessed 24 November 2026.
Chicago "XML Schema." 2026-11-23. https://en.wikipedia.org/w/index.php?oldid=1375801575.
APA encyclopegia.org. (2026). XML Schema. Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1375801575
Cite this article
MLA
"XML Schema." encyclopegia.org, 2026, https://encyclopegia.org/wiki/xml-schema. Accessed 24 November 2026.
Chicago
"XML Schema." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/xml-schema.
APA
encyclopegia.org. (2026). XML Schema. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/xml-schema
Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON
Claims
| Predicate | Value | Source |
|---|---|---|
| year mentioned | 2000 | article body |
| year mentioned | 2005 | article body |
| year mentioned | 2001 | article body |
| year mentioned | 2009 | article body |