词条 | Schematron |
释义 |
Schematron is a rule-based validation language for making assertions about the presence or absence of patterns in XML trees. It is a structural schema language expressed in XML using a small number of elements and XPath. In a typical implementation, the Schematron schema XML is processed into normal XSLT code for deployment anywhere that XSLT can be used. Schematron is capable of expressing constraints in ways that other XML schema languages like XML Schema and DTD cannot. 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 also specify required relationships between multiple XML files. Constraints and content rules may be associated with "plain-English" validation error messages, allowing translation of numeric Schematron error codes into meaningful user error messages. The current ISO recommendation is Information technology, Document Schema Definition Languages (DSDL), Part 3: Rule-based validation, Schematron (ISO/IEC 19757-3:2016). UsesConstraints are specified in Schematron using an XPath-based language that can be deployed as XSLT code, making it practical for applications such as the following:
VersionsSchematron was invented by Rick Jelliffe at Academia Sinica Computing Centre, Taiwan. He described Schematron as "a feather duster to reach the parts other schema languages cannot reach". The most common versions of Schematron are:
Schematron as an ISO StandardSchematron has been standardized by the ISO as Information technology, Document Schema Definition Languages (DSDL), Part 3: Rule-based validation, Schematron (ISO/IEC 19757-3:2016). This standard is available free on the ISO Publicly Available Specifications list. Paper versions may be purchased from ISO or national standards bodies. Schemas that use ISO/IEC FDIS 19757-3 should use the following namespace: Sample ruleSchematron rules can be created using a standard XML editor or XForms application. The following is a sample schema: 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. ImplementationSchematron schemas are suitable for use in XML Pipelines, thereby allowing workflow process designers to build and maintain rules using XML manipulation tools. The W3C's XProc pipelining language, for example, has native support for Schematron schema processing through its "validate-with-schematron" step.[3] Since Schematron schemas can be transformed into XSLT stylesheets, these can themselves be used in XML Pipelines which support XSLT transformation. An Apache Ant task can be used to convert Schematron rules into XSLT files. There exists also native Schematron implementation, like the Java implementation from Innovimax/INRIA, [https://project.inria.fr/quix-tool-suite/quixschematron/ QuiXSchematron], that also do streaming. See also
External links
References1. ^{{Cite paper|title=Schematron - More useful than you’d thought|first=Philip|last=Fennell|date=June 2014|journal=XML London 2014|doi=10.14337/XMLLondon14.Fennell01|pages=103–112|isbn=978-0-9926471-1-7|url=http://xmllondon.com/2014/presentations/fennell/}} {{Authority control}}2. ^{{Citation |series=Information technology — Document Schema Definition Languages (DSDL) |title=Part 3: Rule-based validation — Schematron (ISO/IEC 19757-3:2006) |date=2006-06-01 | publisher=ISO/IEC | format=zip | url=http://standards.iso.org/ittf/PubliclyAvailableStandards/c040833_ISO_IEC_19757-3_2006%28E%29.zip|accessdate=2014-06-15}} 3. ^{{cite web|url=http://www.w3.org/TR/xproc/#c.validate-with-schematron|title=XProc: An XML Pipeline Language|section=7.2.5|publisher=World Wide Web Consortium|date=2010-05-11|accessdate=2012-11-12}} 5 : Data modeling languages|ISO/IEC standards|XML|XML-based programming languages|XML-based standards |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。