Embedding Schematron Quick Fixes in Relax NG or XML Schema
Schematron Quick Fixes can be
embedded into an XML Schema through annotations (using the <appinfo>
element), or in a Schematron rule embedded in the RELAX NG Schema. For more information about
embedding Schematron in XML Schema or Relax NG, see Embedding Schematron Rules in XML Schema or RELAX NG.
Oxygen XML Developer is able to extract and use the embedded Schematron Quick
Fixes. To make the embedded Schematron Quick Fixes available, follow
these steps:
- Define a validation against a schema.
- For the Schema type, choose XML Schema or Relax NG.
- Select the Embedded Schematron rules option.
Example: Embedded Schematron Quick Fix in XML
Schema
<xsd:appinfo>
<sch:pattern>
<sch:rule context="...">
<sch:assert test="..." sqf:fix="fixId">Message.</sch:assert>
<sqf:fix id="fixId">
......
</sqf:fix>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
Example: Embedded Schematron Quick Fix in Relax
NG
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:sch="http://purl.oclc.org/dsdl/schematron" >
<sch:pattern>
<sch:rule context="...">
<sch:assert test="..." sqf:fix="fixId">Message.</sch:assert>
<sqf:fix id="fixId">
.....
</sqf:fix>
</sch:rule>
</sch:pattern>
<start>
..............
</start>
</grammar>
Tip: For more extensive examples, see the samples in the
[OXYGEN_INSTALL_DIR]/samples/schematron folder.