xmlunit-004

Tests that differences are reported.

Test xmlunit-004.xml is expected to pass.

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" 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>

Schematron validation

<s:schema xmlns:cxerr="http://xmlcalabash.com/ns/error" xmlns:s="http://purl.oclc.org/dsdl/schematron" 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.