Editing Schematron Schemas
Schematron is a simple and powerful Structural Schema Language for making assertions about patterns found in XML documents. It relies almost entirely on XPath query patterns for defining rules and checks. Schematron validation rules allow you to specify a meaningful error message. This error message is provided to you if an error is encountered during the validation stage.
Oxygen XML Developer Eclipse plugin assists you in editing Schematron documents with schema-based content completion, syntax highlight, search and refactor actions, and dedicated icons for the Outline view. You can create a new Schematron schema using one of the Schematron templates available in the New from Templates wizard.
For information about applying and detecting Schematron schemas, see Associating a Schema to XML Documents.
Validating XML Documents Against Schematron
The Skeleton XSLT processor is used for validation and conforms with ISO Schematron or Schematron 1.5. It allows you to validate XML documents against Schematron schemas or against combined RELAX NG / W3C XML Schema and Schematron.
How to Specify the Query Language Binding
- For embedded ISO Schematron, open the Preferences dialog box , go to , and select it in the Embedded rules query language binding option.
- For standalone ISO Schematron, specify the version by setting the query language to be
used in a
@queryBinding
attribute on the schema root element. For more information, see the Query Language Binding section of the Schematron specifications. - For Schematron 1.5 (standalone and embedded), open the Preferences dialog box , go to , and select the version in the XPath Version option.
Multi-Lingual Support in Schematron Messages
You can specify the desired language for the validation messages in the
Schematron Preferences page. The Schematron validation
messages can be presented in multiple languages by defining the language for each message
using the Schematron <diagnostics>
element.
<assert>
element. You can specify
the language of the diagnostic message by adding the xml:lang
attribute on
the sch:diagnostic
element or on its
parent:<sch:assert test="bone" diagnostics="d_en d_de">
A dog should have a bone.
</sch:assert>
….
<sch:diagnostics>
<sch:diagnostic id="d_en" xml:lang="en">
A dog should have a bone.
</sch:diagnostic>
<sch:diagnostic id="d_de" xml:lang="de">
Das Hund muss ein Bein haben.
</sch:diagnostic>
</sch:diagnostics>
How to Customize Color Schemes in Schematron
The Schematron editor renders the XPath expressions with dedicated color schemes. To customize the coloring schemes, open the Preferences dialog box and go to .
Schematron Transformation Scenario
When you create a Schematron document, Oxygen XML Developer Eclipse plugin provides a built-in transformation scenario. You can use this scenario to obtain the XSLT style-sheet corresponding to the Schematron schema. You can apply this XSLT stylesheet to XML documents to obtain the Schematron validation results.
Resources
For more information about the Schematron support in Oxygen XML Developer Eclipse plugin, watch our video demonstrations: