XML schema

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. An XML schema provides a view of the document type at a relatively high level of abstraction.

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 other very popular, more expressive XML schema languages are XML Schema (W3C) 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.

Validations

The process of checking to see if an XML document conforms to a schema is called validation, which is separate from XML's core concept of syntactic well-formedness. All XML documents must be well-formed, but it is not required that a document be valid unless the XML parser is "validating," in which case the document is also checked for conformance with its associated schema. DTD-validating parsers are most common, but some support W3C XML Schema or RELAX NG as well.

Documents are only considered valid if they satisfy the requirements of the schema with which they have been associated. These requirements typically include such constraints as:

* Elements and attributes that must/may be included, and their permitted structure
* The structure is specified by a regular expression syntax
* How character data is to be interpreted, e.g. as a number, a date, a URL, a Boolean, etc.

XML Schema validations can be effectively performed using specialized parsers like JAXB or SAX.

XML schema languages

* Document Definition Markup Language (DDML)
* Document Schema Definition Languages (DSDL)
* Document Structure Description (DSD)
* Document Type Definition (DTD)
* Namespace Routing Language (NRL)
* RELAX NG and its predecessors RELAX and TREX
* SGML
* Schema for Object-Oriented XML (SOX)
* Schematron
* XML-Data Reduced (XDR)
* XML Schema (W3C) (WXS or XSD)

Capitalization

There is some confusion as to when to use the capitalized spelling "Schema" and when to use the lowercase spelling. The lowercase form is a generic term and may refer to any type of schema, including DTD, XML Schema (aka: XSD), RelaxNG, or others and should always be written using lowercase except when appearing at the start of a sentence. The form "Schema" (capitalized) in common use in the XML community always refers to W3C XML Schema.

See also

* Data structure
* Structuring information
* List of XML schemas
* XML Information Set
* XML Schema Language Comparison
* Schema (for other uses of the term)

Criticism

Criticisms of XML Schema language include the following:
* The specification is very large, which makes it difficult to understand and implement.
* The XML-based syntax leads to verbosity in schema descriptions, which makes XSDs harder to read and write.
* Schema validation can be an expensive addition to XML parsing, especially for high volume systems.
* The modeling capabilities are very limited, with no ability to allow attributes to influence content models.
* The type derivation model is very limited, in particular that derivation by extension is rarely useful.
* Database-related data transfer is supported with ideas such as nillability, but the requirements of industrial publishing are under-supported.
* The key/keyref/uniqueness mechanisms are not type-aware.
* The PSVI concept (Post Schema Validation Infoset) does not have a standard XML representation or Application Programming Interface, thus it works against vendor independence unless revalidation is performed.

External links

* [http://www.xml.com/pub/a/2001/12/12/schemacompare.html Comparing XML Schema Languages] by Eric van der Vlist (2001)
* [http://pike.psu.edu/publications/sigmod-record-00.pdf 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
* [http://pike.psu.edu/publications/toit05.pdf 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
* [http://skaterpro.net/xsd.htm Brief XSD Schema Tutorial]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • XML-Schema — ist eine Empfehlung des W3C zum Definieren von Strukturen für XML Dokumente. Anders als bei den klassischen XML DTDs wird die Struktur in Form eines XML Dokuments beschrieben. Darüber hinaus wird eine große Anzahl von Datentypen unterstützt.… …   Deutsch Wikipedia

  • XML Schema — XML Schema, abgekürzt XSD, ist eine Empfehlung des W3C zum Definieren von Strukturen für XML Dokumente. Anders als bei den klassischen XML DTDs wird die Struktur in Form eines XML Dokuments beschrieben. Darüber hinaus wird eine große Anzahl von… …   Deutsch Wikipedia

  • XML Schema — es un lenguaje de esquema utilizado para describir la estructura y las restricciones de los contenidos de los documentos XML de una forma muy precisa, más allá de las normas sintácticas impuestas por el propio lenguaje XML. Se consigue así una… …   Wikipedia Español

  • XML Schema — publié comme recommandation par le W3C en mai 2001 est un langage de description de format de document XML permettant de définir la structure et le type de contenu d un document XML. Cette définition permet notamment de vérifier la validité de ce …   Wikipédia en Français

  • XML Schéma — XML Schema XML Schema publié comme recommandation par le W3C en mai 2001 est un langage de description de format de document XML permettant de définir la structure d un document XML. La connaissance de la structure d un document XML permet… …   Wikipédia en Français

  • XML Schema — XML Schema  язык описания структуры XML документа. Спецификация XML Schema является рекомендацией W3C. Как большинство языков описания XML, XML Schema была задумана для определения правил, которым должен подчиняться документ. Но, в отличие… …   Википедия

  • XML Schema Definition — XML Schema ist eine Empfehlung des W3C zum Definieren von Strukturen für XML Dokumente. Anders als bei den klassischen XML DTDs wird die Struktur in Form eines XML Dokuments beschrieben. Darüber hinaus wird eine große Anzahl von Datentypen… …   Deutsch Wikipedia

  • XML Schema (W3C) — XML Schema один из языков описания структуры XML Schema получила статус рекомендации Консорциума W3C 2 мая 2001 года, став первым стандартом описания XML, получившим статус рекомендации. Как большинство языков описания XML, XML Schema была… …   Википедия

  • XML Schema (W3C) — dablink|This article is about the W3C s XML Schema language. For information about XML schema languages in general, see XML schemainfobox file format name = XML Schema (W3C) extension = .xsd mime = application/xml, text/xml owner = [http://www.w3 …   Wikipedia

  • XML Schema Language Comparison — 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 syntax constraints imposed by XML itself. There are several… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”