User-Friendly Diagnostics

Roger Costello

Click arrow key () to navigate to next page

Error Messages for Non-Experts

The <sch:diagnostics> Element

Schematron Schema

  1. <?xml version="1.0"?>
  2. <sch:schema xmlns:sch="http://www.ascc.net/xml/schematron">
  3. <sch:pattern name="..."> ... </sch:pattern>
  4. <sch:pattern name="..."> ... </sch:pattern>
  5. <sch:pattern name="..."> ... </sch:pattern>
  6. <sch:diagnostics>
  7. <sch:diagnostic id="...">...</sch:diagnostic>
  8. <sch:diagnostic id="...">...</sch:diagnostic>
  9. <sch:diagnostic id="...">...</sch:diagnostic>
  10. </sch:diagnostics>
  11. </sch:schema>

The <sch:diagnostic> Element

  1. <sch:diagnostic id="invalid-security-label">
  2. Your document does not meet the Security Classification Policy. Your Para has a security
  3. label of <sch:value-of select="./@classification"/>, which has a higher sensitivity than the document's
  4. sensitivity: <sch:value-of select="/Document/@classification"/>
  5. </sch:diagnostic>

The <sch:value-of> Element

  1. <sch:value-of select="./@classification"/>

Associating Assertion to Diagnostic

  1. <sch:assert test="/Document/@classification='top-secret'" diagnostics="invalid-security-label">
  2. If there is a Para labeled "top-secret" then the Document
  3. should be labeled top-secret
  4. </sch:assert>

Diagnostics in Oxygen XML

Example

Lab 4

Homepage