As of 2020-08-29 there are 49 conformance tests defined.
ISO Schematron 2016: Section 5.4.5 clause 1
Running Schematron validation with this input should report a valid document.
document.xml
<element/>
<sch:schema><sch:pattern><sch:let name="foobar" value="1"/><sch:rule context="/"><sch:assert test="true()"/></sch:rule></sch:pattern><sch:pattern><sch:rule context="/"><sch:assert test="$foobar = 1"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 6.5 clause 6
Running Schematron validation with this input should report a valid document.
document.xml
<element/>
<sch:schema><sch:phase id="phase"><sch:let name="phase-var" value="1"/><sch:active pattern="pattern"/></sch:phase><sch:pattern id="pattern"><sch:rule context="*"><sch:let name="rule-var" value="$phase-var + 1"/><sch:assert test="$rule-var = 2"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 6.5 clause 6
Running Schematron validation with this input should report a valid document.
document.xml
<element/>
<sch:schema><sch:let name="global-var" value="1"/><sch:pattern><sch:rule context="*"><sch:let name="rule-var" value="$global-var + 1"/><sch:assert test="$rule-var = 2"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Annex C Clause 11 (xslt), Annex H Clause 11 (xslt2)
Running Schematron validation with this input should report an invalid document.
In addition, the following XPath expressions are expected to return the effective boolean value of
true()
when evaluated with the output of the Schematron validation process as context node:
count(//svrl:property-reference/*) > 0
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule context="*"><sch:assert test="false()" properties="copy-of"/></sch:rule></sch:pattern><sch:properties><sch:property id="copy-of"><xsl:copy-of select="."/></sch:property></sch:properties></sch:schema>
ISO Schematron 2016: Section 6.3
Running Schematron validation with this input should report an invalid document.
document.xml
<element/>
<sch:schema><sch:pattern abstract="true" id="abstract-pattern"><sch:rule context="$context"><sch:assert test="$placeholder = 0"/></sch:rule></sch:pattern><sch:pattern is-a="abstract-pattern"><sch:param name="context" value="element"/><sch:param name="placeholder" value="1"/></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.12 clause 5
Running Schematron validation with this input should report an invalid document.
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule abstract="true" id="abstract-rule"><sch:report test="self::element"/></sch:rule><sch:rule context="element"><sch:extends rule="abstract-rule"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Annex H, XSLT 2.0 Section 16.3.1
This test requires the processor to support the following features: xslt2.
Running Schematron validation with this input should report a valid document.
document.xml
<document/>
<sch:schema><xsl:key name="key" match="*"><xsl:text>key</xsl:text></xsl:key><sch:pattern><sch:rule context="/"><sch:assert test="count(key('key', 'key')) = 1"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Annex C Clause 2 (xslt), Annex H Clause 2 (xslt2), Annex I Clause 2 (xpath2)
Running Schematron validation with this input should report an invalid document.
document.xml
<root><-- Comment! --></root>
<sch:schema><sch:pattern><sch:rule context="comment()"><sch:assert test="false()"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Annex C Clause 2 (xslt), Annex H Clause 2 (xslt2), Annex I Clause 2 (xpath2)
Running Schematron validation with this input should report an invalid document.
document.xml
<root><?processing-instruction foobar ?></root>
<sch:schema><sch:pattern><sch:rule context="processing-instruction()"><sch:assert test="false()"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Annex C Clause 2 (xslt), Annex H Clause 2 (xslt2)
Running Schematron validation with this input should report an invalid document.
document.xml
<root>Content</root>
<sch:schema><sch:pattern><sch:rule context="text()"><sch:assert test="false()"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Annex C Clause 2 (xslt), Annex H Clause 2 (xslt2), Annex I Clause 2 (xpath2)
Running Schematron validation with this input should report an invalid document.
document.xml
<element attribute="value"/>
<sch:schema><sch:pattern><sch:rule context="@attribute"><sch:assert test="false()"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Annex C Clause 2 (xslt), Annex H Clause 2 (xslt2), Annex I Clause 2 (xpath2)
Running Schematron validation with this input should report an invalid document.
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule context="element"><sch:assert test="false()"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Annex C clause 2 (xslt), Annex H clause 2 (xslt2)
Running Schematron validation with this input should report an invalid document.
document.xml
<root/>
<sch:schema><sch:pattern><sch:rule context="/"><sch:assert test="false()"/></sch:rule></sch:pattern></sch:schema>
This test requires the processor to support the following features: svrl.
Running Schematron validation with this input should report an invalid document.
In addition, the following XPath expressions are expected to return the effective boolean value of
true()
when evaluated with the output of the Schematron validation process as context node:
count(//svrl:successful-report/svrl:diagnostic-reference[@diagnostic = 'd1' or @diagnostic = 'd2']) = 2
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule context="/"><sch:report test="true()" diagnostics="d1 d2"/></sch:rule></sch:pattern><sch:diagnostics><sch:diagnostic id="d1">
Context: <sch:value-of select="name()"/></sch:diagnostic><sch:diagnostic id="d2">
Context: <sch:value-of select="name()"/></sch:diagnostic></sch:diagnostics></sch:schema>
Running Schematron validation with this input should report an invalid document.
document.xml
<element/>
include.sch
<rule><extends href="true.sch"/></rule>
true.sch
<rule context="/"><report test="true()"/></rule>
<sch:schema><sch:pattern><sch:rule context="/"><sch:extends href="include.sch"/></sch:rule></sch:pattern></sch:schema>
XML Inclusions (XInclude) Version 1.1, Section 4.7.5.
Running Schematron validation with this input should report a valid document.
document.xml
<element/>
subdir/include.sch
<rule context="/"><assert test="local-name(document('include.sch')/*[1]) = 'rule'"/></rule>
<sch:schema><sch:pattern><sch:rule context="/"><sch:extends href="subdir/include.sch"/></sch:rule></sch:pattern></sch:schema>
Running Schematron validation with this input should report an invalid document.
document.xml
<element/>
pattern.sch
<pattern><include href="rule.sch"/></pattern>
rule.sch
<rule context="/"><report test="true()"/></rule>
<sch:schema><sch:include href="pattern.sch"/><sch:pattern/></sch:schema>
XML Inclusions (XInclude) Version 1.1, Section 4.7.5.
Running Schematron validation with this input should report an invalid document.
document.xml
<element/>
subdir/include.sch
<rule context="/"><report test="local-name(document('include.sch')/*[1]) = 'rule'"/></rule>
<sch:schema><sch:pattern><sch:include href="subdir/include.sch"/></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.5 Clause 3
Running Schematron validation with this input should cause an error.
document.xml
<element/>
<sch:schema><sch:let name="foo" value="'bar'"/><sch:pattern><sch:let name="foo" value="'bar'"/><sch:rule context="/"><sch:assert test="true()"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.5 Clause 3
Running Schematron validation with this input should cause an error.
document.xml
<element/>
<sch:schema><sch:pattern><sch:let name="foo" value="'bar'"/><sch:let name="foo" value="'bar'"/><sch:rule context="/"><sch:assert test="true()"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.5 Clause 3
Running Schematron validation with this input should cause an error.
document.xml
<element/>
<sch:schema><sch:phase id="phase"><sch:let name="foo" value="'bar'"/><sch:let name="foo" value="'bar'"/><sch:active pattern="pattern"/></sch:phase><sch:pattern id="pattern"><sch:rule context="/"><sch:assert test="true()"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.5 Clause 3
Running Schematron validation with this input should cause an error.
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule context="/"><sch:let name="foo" value="'bar'"/><sch:let name="foo" value="'bar'"/><sch:assert test="true()"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.5 Clause 3
Running Schematron validation with this input should cause an error.
document.xml
<element/>
<sch:schema><sch:let name="foo" value="'bar'"/><sch:let name="foo" value="'bar'"/><sch:pattern><sch:rule context="/"><sch:assert test="true()"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.5 clause 3
Running Schematron validation with this input should cause an error.
document.xml
<element/>
<sch:schema><sch:let name="foobar" value="1"/><sch:pattern><sch:let name="foobar" value="1"/><sch:rule context="/"><sch:assert test="true()"/></sch:rule></sch:pattern><sch:pattern><sch:rule context="/"><sch:assert test="$foobar = 1"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.12 clause 5
Running Schematron validation with this input should cause an error.
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule abstract="true" id="abstract-rule"><sch:report test="self::element"/></sch:rule></sch:pattern><sch:pattern><sch:rule context="element"><sch:extends rule="abstract-rule"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.5 Clause 3
Running Schematron validation with this input should cause an error.
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule context="*[local-name() = $localname]"><sch:assert test="true()"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.5 Clause 3
Running Schematron validation with this input should cause an error.
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule context="*"><sch:assert test="$variable = 1"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.5 Clause 3
Running Schematron validation with this input should cause an error.
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule context="*"><sch:report test="$variable = 1"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.5 Clause 3
Running Schematron validation with this input should cause an error.
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule context="*"><let name="ruleVariable" value="$variable"/><sch:assert test="$ruleVariable"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.5 Clause 3
Running Schematron validation with this input should cause an error.
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule context="*"><sch:assert test="false()"><sch:name path="$variable"/></sch:assert></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.5 Clause 3
Running Schematron validation with this input should cause an error.
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule context="*"><sch:assert test="false()"><sch:value-of select="$variable"/></sch:assert></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.5 Clause 3
This test requires the processor to support the following features: iso2016.
Running Schematron validation with this input should cause an error.
document.xml
<element/>
<sch:schema><sch:pattern documents="$variable"><sch:rule context="*"><sch:assert test="true()"/></sch:rule></sch:pattern></sch:schema>
This test requires the processor to support the following features: svrl.
Running Schematron validation with this input should report an invalid document.
In addition, the following XPath expressions are expected to return the effective boolean value of
true()
when evaluated with the output of the Schematron validation process as context node:
count(//svrl:successful-report/svrl:diagnostic-reference/svrl:text[@xml:lang = 'de']) = 1
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule context="/"><sch:report test="true()" diagnostics="d1"/></sch:rule></sch:pattern><sch:diagnostics><sch:diagnostic id="d1" xml:lang="de">
Context: <sch:value-of select="name()"/></sch:diagnostic></sch:diagnostics></sch:schema>
ISO Schematron 2016: Section 5.4.5 clause 2
Running Schematron validation with this input should report a valid document.
document.xml
<element/>
<sch:schema queryBinding="xslt"><sch:ns prefix="html" uri="http://www.w3.org/1999/xhtml"/><sch:let name="foobar"><html:p>This is a paragraph</html:p></sch:let><sch:pattern><sch:rule context="/"><sch:assert test="contains($foobar, 'paragraph')"/></sch:rule></sch:pattern></sch:schema>
<sch:schema><sch:ns prefix="html" uri="http://www.w3.org/1999/xhtml"/><sch:let name="foobar"><html:p>This is a paragraph</html:p></sch:let><sch:pattern><sch:rule context="/"><sch:assert test="count($foobar/html:p) = 1"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 6.5 Clause 5
Running Schematron validation with this input should report a valid document.
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule context="element"><sch:assert test="true()"/></sch:rule><sch:rule context="*"><sch:assert test="false()"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.9 clause 2
This test requires the processor to support the following features: iso2016.
Running Schematron validation with this input should report an invalid document.
document.xml
<element secondary="document-02.xml"/>
document-02.xml
<root/>
<sch:schema><sch:pattern documents="/element/@secondary"><sch:rule context="/"><sch:report test="root"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 3.26
Running Schematron validation with this input should report a valid document.
document.xml
<document/>
<sch:schema><sch:let name="foo" value="0"/><sch:pattern><sch:let name="foo" value="1"/><sch:rule context="*"><sch:assert test="$foo = 1"/></sch:rule></sch:pattern><sch:pattern><sch:rule context="*"><sch:assert test="$foo = 0"/></sch:rule></sch:pattern></sch:schema>
This test requires the processor to support the following features: svrl.
Running Schematron validation with this input should report an invalid document.
In addition, the following XPath expressions are expected to return the effective boolean value of
true()
when evaluated with the output of the Schematron validation process as context node:
count(//svrl:successful-report/svrl:property-reference[@property = 'p1' or @property = 'p2']) = 2
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule context="/"><sch:report test="true()" properties="p1 p2"/></sch:rule></sch:pattern><sch:properties><sch:property id="p1">
Context: <sch:value-of select="name()"/></sch:property><sch:property id="p2">
Context: <sch:value-of select="name()"/></sch:property></sch:properties></sch:schema>
Running Schematron validation with this input should report a valid document.
document.xml
<document/>
<sch:schema><sch:pattern><sch:let name="local-name" value="'document'"/><sch:rule context="*[local-name() = $local-name]"><sch:assert test="true()"/></sch:rule><sch:rule context="*"><sch:assert test="false()"/></sch:rule></sch:pattern></sch:schema>
Running Schematron validation with this input should report a valid document.
document.xml
<document/>
<sch:schema><sch:phase id="phase"><sch:let name="local-name" value="'document'"/><sch:active pattern="pattern"/></sch:phase><sch:pattern><sch:rule context="*[local-name() = $local-name]"><sch:assert test="true()"/></sch:rule><sch:rule context="*"><sch:assert test="false()"/></sch:rule></sch:pattern></sch:schema>
Running Schematron validation with this input should report a valid document.
document.xml
<document/>
<sch:schema><sch:let name="local-name" value="'document'"/><sch:pattern><sch:rule context="*[local-name() = $local-name]"><sch:assert test="true()"/></sch:rule><sch:rule context="*"><sch:assert test="false()"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 3.26
Running Schematron validation with this input should report a valid document.
document.xml
<document/>
<sch:schema><sch:let name="foo" value="0"/><sch:phase id="phase"><sch:let name="foo" value="1"/><sch:active pattern="pattern"/></sch:phase><sch:pattern id="pattern"><sch:rule context="/"><sch:assert test="$foo = 1"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 3.26
Running Schematron validation with this input should report a valid document.
document.xml
<document/>
<sch:schema><sch:pattern><sch:rule context="/"><sch:let name="foo" value="1"/><sch:assert test="$foo = 1"/></sch:rule><sch:rule context="*"><sch:let name="foo" value="0"/><sch:assert test="$foo = 0"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.6, Annex C clause 4 (xslt), Annex H clause 4 (xslt2), Annex I clause 4 (xpath2)
This test requires the processor to support the following features: svrl.
Running Schematron validation with this input should report an invalid document.
In addition, the following XPath expressions are expected to return the effective boolean value of
true()
when evaluated with the output of the Schematron validation process as context node:
normalize-space(//svrl:successful-report) = 'element'
document.xml
<element/>
<sch:schema><sch:pattern><sch:rule context="/element"><sch:report test="true()"><sch:name/></sch:report></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.6, Annex C clause 4 (xslt), Annex H clause 4 (xslt2), Annex I clause 4 (xpath2)
This test requires the processor to support the following features: svrl.
Running Schematron validation with this input should report an invalid document.
In addition, the following XPath expressions are expected to return the effective boolean value of
true()
when evaluated with the output of the Schematron validation process as context node:
normalize-space(//svrl:successful-report) = 'value'
document.xml
<element attribute="value"/>
<sch:schema><sch:pattern><sch:rule context="/element"><sch:report test="true()"><sch:name path="@attribute"/></sch:report></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.14, Annex C clause 5 (xslt), Annex H clause 5 (xslt2), Annex I clause 5 (xpath2)
This test requires the processor to support the following features: svrl.
Running Schematron validation with this input should report an invalid document.
In addition, the following XPath expressions are expected to return the effective boolean value of
true()
when evaluated with the output of the Schematron validation process as context node:
normalize-space(//svrl:successful-report) = 'Text content'
document.xml
<element>Text content</element>
<sch:schema><sch:pattern><sch:rule context="/element"><sch:report test="true()"><sch:value-of select="."/></sch:report></sch:rule></sch:pattern></sch:schema>
This test requires the processor to support the following features: iso2016.
Running Schematron validation with this input should report an invalid document.
document.xml
<element secondary="document-02"/>
document-02.xml
<root/>
<sch:schema><sch:let name="extension" value="'.xml'"/><sch:pattern documents="concat(/element/@secondary, $extension)"><sch:rule context="/"><sch:report test="root"/></sch:rule></sch:pattern></sch:schema>
Running Schematron validation with this input should report a valid document.
document.xml
<element/>
<sch:schema defaultPhase="phase"><sch:phase id="phase"><sch:active pattern="pass"/></sch:phase><sch:pattern id="fail"><sch:rule context="*"><sch:assert test="false()"/></sch:rule></sch:pattern><sch:pattern id="pass"><sch:rule context="*"><sch:assert test="true()"/></sch:rule></sch:pattern></sch:schema>
ISO Schematron 2016: Section 5.4.13 clause 3
Running Schematron validation with this input should report a valid document.
document.xml
<element/>
<sch:schema defaultPhase="phase"><sch:phase id="phase"><sch:active pattern="pass"/></sch:phase><sch:pattern id="fail"><sch:rule context="*"><sch:assert test="false()"/></sch:rule></sch:pattern><sch:pattern id="pass"><sch:rule context="*"><sch:assert test="true()"/></sch:rule></sch:pattern></sch:schema>