Schematron

Schematron

In Markup Languages, Schematron is a rule-based validation language for making assertions about the presence or absence of patterns in XML trees. It is a simple and powerful structural schema language expressed in XML using a small number of elements and XPath. The Schematron schema XML is then processed into normal XSLT code for deployment anywhere that XSLT can be used.

Advantages

Because of its rule-based nature, Schematron's specificity is very strong. For example, it can require that the content of an element be controlled by one of its siblings. Or it can request or require that the root element, regardless of what element that is, must have specific attributes. Schematron can even specify required relationships between multiple XML files.

On top of these specific rules are validation error messages expressed in natural language instead of cryptic error codes. This can make error diagnosis by end-users much easier than some other schema languages.

Uses

Schematron's elegant design of a expressing constraints through a simple, XPath-based language but deployed as XSLT code, make it practical for applications such as the following:

;Adjunct to Structural Validation: by testing for co-occurrence constraints, non-regular constraints, and inter-document constraints, Schematron can extend the validations able to be expressed in languages such as DTDs, RELAX NG or XML Schema.

;Lightweight Business Rules Engine: Schematron is not a comprehensive, Rete rules engine, but it can be used to express rules about complex structures with an XML document.

;XML Editor Syntax Highlighting Rules: XML Editors use Schematron rules to conditionally highlight XML files for errors.

History

Schematron was invented by Rick Jelliffe. He described Schematron as "a feather duster to reach the parts other schema languages cannot reach".

Schematron as an ISO Standard

; Schematron has been standardized to become part of : ISO/IEC 19757 - Document Schema Definition Languages (DSDL) - Part 3: Rule-based validation - Schematron.

Namespace Standard

Any files that use ISO/IEC FDIS 19757-3 should use the following namespace:

http://purl.oclc.org/dsdl/schematron

Sample Rule

Schematron rules are very simple to create using a standard XML editor or XForms application. The following is a sample rule:

ContractDate must be in the past.

This rule checks to make sure that the ContractDate XML element has a date that is before the current date. If this rule fails the validation will fail and an error message which is the body of the assert element will be returned to the user.

Implementation

Schematron source files are usually transformed into XSLT files (using XSLT) and placed in an XML Pipeline. This allows workflow process designers to build and maintain rules using standard XML manipulation tools.

For example an Apache Ant task can be used to convert Schematron rules into XSLT files.

ee also

*XML Schema Language Comparison - Comparison to other XML Schema languages.
*Service Modeling Language - Service Modeling Language uses Schematron.

External links

* [http://www.schematron.com ISO Schematron Home Page]
* [http://www.ascc.net/xml/resource/schematron/ Academia Sinica Computing Centre's Schematron Home Page]
* [http://www.eccnet.com/schematron/index.php/Main_Page Schematron Wiki including Implementer's FAQ]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Schematron — se engloba dentro de la familia de lenguajes de marcado XML, siendo un lenguaje de validación basado en reglas y en XPATH. Se basa en afirmaciones en vez de en gramática. Utiliza expresiones de acceso en lugar de gramaticales para definir lo que… …   Wikipedia Español

  • Schematron — Schematron  язык программирования, предназначенный для проверки правильности содержимого XML документов, основанный на правилах, использует XPath и генерацию XSLT. Стандарт ISO/IEC 19757 3:2006. Так как современные форматы офисных документов …   Википедия

  • Schematron — The Schematron ist eine Schemasprache zur Validierung von Inhalt und Struktur von XML Dokumenten. Die Implementierung der Sprache ist über XSL Transformationen realisiert, bedarf also keiner speziellen Implementierung, wie es bei den meisten… …   Deutsch Wikipedia

  • Schematron — En langage de balisage, Schematron est un langage permettant de valider la structure d un document XML pour faire des affirmations sur la présence ou l absence des définitions des modèles utilisés dans l arborescence XML. Il s agit d un langage… …   Wikipédia en Français

  • 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

  • Validación XML — La Validación XML (eXtensible Markup Language) es la comprobación de que un documento en lenguaje XML está bien formado y se ajusta a una estructura definida. Un documento bien formado sigue las reglas básicas de XML establecidas para el diseño… …   Wikipedia Español

  • Rick Jelliffe — Infobox Person name = Richard Alan Jelliffe image size = 200px caption = Rick Jelliffe, 2007 birth name = birth date = 1960 birth place = death date = death place = death cause = resting place = resting place coordinates = residence = nationality …   Wikipedia

  • Dokumenttyp-Definitionssprache — Eine Schemasprache (engl. schema definition language, auch Schema Definitionssprache oder Dokumenttyp Definitionssprache) ist eine Sprache zur Klassifizierung von XML Dokumenten und zur syntaktischen Beschreibung bezüglich ihrer Struktur und… …   Deutsch Wikipedia

  • Schemasprache — Eine Schemasprache (engl. schema definition language, auch Schema Definitionssprache oder Dokumenttyp Definitionssprache) ist eine Sprache zur Klassifizierung von XML Dokumenten und zur syntaktischen Beschreibung bezüglich ihrer Struktur und… …   Deutsch Wikipedia

  • XML — Infobox file format name = Extensible Markup Language icon = logo = extension = .xml mime = application/xml, text/xml (deprecated) type code = uniform type = public.xml magic = owner = World Wide Web Consortium genre = Markup language container… …   Wikipedia

Share the article and excerpts

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