History | Edit

You can define and customize Schematron Quick Fixes directly in the current Schematron file or in a separate Schematron file. The Schematron Quick Fixes are an extension of the Schematron language and they allow you to define fixes for Schematron error messages. You can refer the Quick Fixes from the assert or report elements in the values of the sqf:fix attributes.

Defining a Schematron Quick Fix

The basics of a Schematron Quick Fix is defined by an ID, name, description, and the operations to be executed.
  • ID - Defined by the id attribute from the fix element and must be unique in the current context. It is used to refer the Quick Fix from a report or assert element.
  • Name - The name of the Quick Fix is defined by the title element.
  • Description - Defined by the text in the paragraphs (p) of the description element.
  • Operations - The following basic types of operations (elements) are supported:
    • <sqf:add> Element - To add a new node or fragment in the document.
    • <sqf:delete> Element - To remove a node from the document.
    • <sqf:replace> Element - To replace a node with another node or fragment.
    • <sqf:stringReplace> Element - To replace text content with other text or a fragment.

Figure: Schematron Quick Fix Components

The assertion message that generates the Quick Fix is added as the description of the problem to be fixed. The title is presented as the name of the Quick Fix. The content of the paragraphs (p) within the description element are presented in the tooltip message when the Quick Fix is selected.

Additional Elements Supported in the Schematron Quick Fixes

<sqf:user-entry>
This element defines a value that must be set manually by the user. For more information, see User Entry SQF Operation.
<sqf:call-fix>
This element calls another Quick Fix within a Quick Fix. The called Quick Fix must be defined globally or in the same Schematron rule as the calling Quick Fix. A calling Quick Fix adopts the activity elements of the called Quick Fix and should not include other activity elements. You can also specify which parameters are sent by using the <sqf:with-param> child element.
<sqf:group>
Allows you to group multiple Quick Fixes and refer them from an assert or report element.
<sqf:fixes>
Is defined globally and contains global fixes and groups of fixes.
<sqf:keep>
Used to copy the selected nodes that are specified by the select attribute.
Note: In Oxygen XML Editor the copied nodes cannot be manipulated by the current or other activity elements.
<sqf:param>
Defines a parameter for a Quick Fix. If the parameter is defined as abstract then the type and default value should not be specified and the fix can be called from an abstract pattern that defines this parameter.

Other SQF Notes

Note: The sqf:default-fix attribute is ignored in Oxygen XML Editor.

For more details on editing Schematron Quick Fixes, go to: Schematron Quick Fix Specifications