Edit online

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 Eclipse plugin is able to extract and use the embedded Schematron Quick Fixes. To make the embedded Schematron Quick Fixes available, follow these steps:
  1. Define a validation against a schema.
  2. For the Schema type, choose XML Schema or Relax NG.
  3. 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.