xmlunit-004
The pipeline
<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
xmlns:cxerr="http://xmlcalabash.com/ns/error" xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" name="main" version="3.0">
<p:import href="https://xmlcalabash.com/ext/library/xmlunit.xpl"/>
<p:output port="result" sequence="true" pipe="report"/>
<cx:xmlunit check-for="identity"
fail-if-not-equal="false">
<p:with-input port="source">
<flowers>
<flower>Daisy</flower>
<flower>Roses</flower>
<flower>Crocus</flower>
</flowers>
</p:with-input>
<p:with-input port="alternate">
<flowers>
<flower>Roses</flower>
<flower>Daisy</flower>
<flower>Crocus</flower>
</flowers>
</p:with-input>
</cx:xmlunit>
</p:declare-step>
Result
<xvrl:report xmlns:cx="http://xmlcalabash.com/ns/extensions"
xmlns:t="http://xproc.org/ns/testsuite/3.0" xmlns:xvrl="http://www.xproc.org/ns/xvrl"
cx:ignore-comments="false" cx:ignore-whitespace="false"
cx:normalize-whitespace="false" cx:check-for="identity"
cx:element-selector="by-name">
<xvrl:metadata>
<xvrl:timestamp>2025-06-19T18:02:52.221503781Z</xvrl:timestamp>
<xvrl:validator name="xmlunit" version="unknown"/>
</xvrl:metadata>
<xvrl:detection severity="error">
<xvrl:location href="file:/woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/extra-suite/test-suite/tests/xmlunit-004.xml"
xpath="/flowers[1]/flower[1]/text()[1]"/>
<xvrl:message>Expected text value 'Daisy' but was 'Roses'</xvrl:message>
</xvrl:detection>
<xvrl:detection severity="error">
<xvrl:location href="file:/woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/extra-suite/test-suite/tests/xmlunit-004.xml"
xpath="/flowers[1]/flower[1]/text()[1]"/>
<xvrl:message>Expected text value 'Daisy' but was 'Roses'</xvrl:message>
</xvrl:detection>
<xvrl:detection severity="error">
<xvrl:location href="file:/woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/extra-suite/test-suite/tests/xmlunit-004.xml"
xpath="/flowers[1]/flower[2]/text()[1]"/>
<xvrl:message>Expected text value 'Roses' but was 'Daisy'</xvrl:message>
</xvrl:detection>
<xvrl:detection severity="error">
<xvrl:location href="file:/woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/extra-suite/test-suite/tests/xmlunit-004.xml"
xpath="/flowers[1]/flower[2]/text()[1]"/>
<xvrl:message>Expected text value 'Roses' but was 'Daisy'</xvrl:message>
</xvrl:detection>
<xvrl:digest valid="false" fatal-error-count="0"
error-count="4" warning-count="0" info-count="0"
unspecified-count="0" fatal-error-codes="" error-codes=""
warning-codes="" info-codes="" unspecified-codes=""
worst="error"/>
</xvrl:report>
Schematron checks
<s:schema xmlns:cxerr="http://xmlcalabash.com/ns/error"
xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:t="http://xproc.org/ns/testsuite/3.0"
queryBinding="xslt2">
<s:ns prefix="xvrl"
uri="http://www.xproc.org/ns/xvrl"/>
<s:pattern>
<s:rule context="/">
<s:assert test="xvrl:report">The output is not an XVRL report.</s:assert>
<s:assert test="xvrl:report/xvrl:metadata/xvrl:validator/@name = 'xmlunit'">The validator is incorrect.</s:assert>
<s:assert test="xvrl:report/xvrl:digest/@error-count = 4">The error count is incorrect.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 21 Feb 2025, Norm Tovey-Walsh
Created test.