Tests that NVDL errors are reported in the XVRL.
Test validate-nvdl-001.xml is expected to pass.
<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:err="http://www.w3.org/ns/xproc-error" xmlns:p="http://www.w3.org/ns/xproc" version="3.0">
<p:output port="result" pipe="report@xml-validation"/>
<p:validate-with-nvdl name="xml-validation" assert-valid="false">
<p:with-input port="source" href="../../../3.0-test-suite/test-suite/documents/NDVL-Book-invalid.xml"/>
<p:with-input port="nvdl" href="../../../3.0-test-suite/test-suite/documents/NVDL.nvdl"/>
</p:validate-with-nvdl>
<p:sink/>
</p:declare-step>
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<s:ns prefix="xvrl" uri="http://www.xproc.org/ns/xvrl"/>
<s:ns prefix="saxon" uri="http://saxon.sf.net/"/>
<s:pattern>
<s:rule context="/">
<s:assert test="xvrl:report">The result isn’t a report.</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/xvrl:report">
<s:assert test="xvrl:digest">The report doesn’t include a digest.</s:assert>
<s:assert test="xvrl:detection[@severity='error']">The result doesn’t include an error</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/xvrl:report/xvrl:metadata">
<s:assert test="xvrl:timestamp">The metadata isn’t timestamped.</s:assert>
<s:assert test="xvrl:validator">The metadata doesn’t include the validator.</s:assert>
<s:assert test="xvrl:validator[@name='Jing']">The validator is unexpected.</s:assert>
<s:assert test="xvrl:creator">The metadata doesn’t include the creator.</s:assert>
<s:assert test="xvrl:creator[@name='XML Calabash']">The creator is unexpected.</s:assert>
<s:assert test="xvrl:schema">The metadata doesn’t include the schema.</s:assert>
<s:assert test="xvrl:schema[@schematypens='http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0']">The schema type is unexpected.</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/xvrl:report/xvrl:digest">
<s:assert test="@warning-count=0">The warning count is wrong</s:assert>
<s:assert test="@error-count=4">The error count is wrong</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Created test.