Progressive Validation
Click arrow key () to navigate to next page
Progressive Validation
- Progressive validation is the validation of constraints in stages (rather than validating everything all at once).
- Progressive validation enables workflow.
- Progressive validation is accomplished through the Schematron <phase> element.
Schematron Schema
- A Schematron schema is comprised of zero or more <phase> elements, followed by one or more <pattern> elements, followed
by an optional <diagnostics> element.
Schematron Schema
- <?xml version="1.0"?>
- <sch:schema xmlns:sch="http://www.ascc.net/xml/schematron">
- <sch:phase id="..."> ... </sch:phase>
- <sch:phase id="..."> ... </sch:phase>
- <sch:phase id="..."> ... </sch:phase>
- ...
- <sch:pattern name="..." id="..."> ... </sch:pattern>
- <sch:pattern name="..." id="..."> ... </sch:pattern>
- <sch:pattern name="..." id="..."> ... </sch:pattern>
- ...
- <sch:diagnostics>...</sch:diagnostics>
- </sch:schema>
Phase Element
- A <phase> element is uniquely identified with an id attribute, and is comprised of one or more <active> elements.
- <sch:phase id="...">
- <sch:active pattern="..." />
- <sch:active pattern="..." />
- <sch:active pattern="..." />
- ...
- </sch:phase>
- The pattern attribute has an IDREF value -- it references an id attribute on a <pattern> element.
Pattern Element Revisited
- The <pattern> element has a mandatory name attribute and an optional id attribute.
- If your Schematron schema contains <active> elements then the <pattern> element's id attribute is mandatory. It has an ID value.
- By default, all <pattern> elements are active. However, the <phase> element enables you to override the default behavior, and control which <pattern> elements are active.
Example (cont.)
- <sch:phase id="classificationValidation">
- <sch:active pattern="SCP" />
- </sch:phase>
- <sch:phase id="reservedWordValidation">
- <sch:active pattern="RWF" />
- </sch:phase>
- <sch:pattern name="Security Classification Policy" id="SCP">...</sch:pattern>
- <sch:pattern name="Reserved Word Filter" id="RWF">...</sch:pattern>
Phased Validation using Oxygen XML
- Open Oxygen XML. Drag and drop valid-document.xml (example07 folder) into Oxygen XML. Click on the leftmost red check mark
(hovering over it displays Reset Cache and Validate). Select one of the phases. Repeat, but select the other phase. Repeat with
invalid-document.xml (example07 folder).
Phased Validation using Oxygen XML
When the leftmost red check mark is selected, a dialog box will open, displaying the different phases that are available, and #All for
activating all patterns.
Phased Validation using Topologi
Phased Validation using Topologi
When the run button is selected, a dialog box will open, displaying the different phases that are available, and #All for
activating all patterns.
Lab 6
- Combine the patterns you created in lab 1 and lab 2 into a single Schematron schema.
- Create two phases -- one for checking the security classifications, the second for checking reserved words.
- Validate valid-document.xml (lab06 folder)
against your Schematron schema.
- Validate invalid-document.xml (lab06 folder)
against your Schematron schema.
- Use both Oxygen XML and Topologi to do the phased validation.