Embed 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 XML Schema or RELAX NG with Embedded Schematron Rules.
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 our samples in the [OXYGEN_INSTALL_DIR]/samples/schematron
folder.