nw-validate-with-xsd-004
Check that errors are reported.
Test is expected to pass.
The pipeline
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" name="pipeline" version="3.0">
<p:output port="result"/>
<p:try>
<p:output port="result"/>
<p:validate-with-xml-schema use-location-hints="false">
<p:with-input port="source"
href="../documents/xsd-document.xml"/>
<p:with-input port="schema">
<p:empty/>
</p:with-input>
</p:validate-with-xml-schema>
<p:catch name="catch">
<p:output port="result"/>
<p:identity>
<p:with-input pipe="error@catch"/>
</p:identity>
</p:catch>
</p:try>
</p:declare-step>
Result
<c:errors xmlns:c="http://www.w3.org/ns/xproc-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" xmlns:t="http://xproc.org/ns/testsuite/3.0">
<c:error name="!validate-with-xml-schema"
type="p:validate-with-xml-schema" code="err:XC0156"
href="file:/woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/tests/nw-validate-with-xsd-004.xml" line="38" column="60">
<cx:message>XML Schema validation failed.</cx:message>
<cx:explanation>It is a dynamic error if the assert-valid option on p:validate-with-xml-schema
is true and the input document is not valid.</cx:explanation>
<xvrl:report xmlns:xvrl="http://www.xproc.org/ns/xvrl">
<xvrl:metadata>
<xvrl:timestamp>2025-06-19T18:06:52.443850325Z</xvrl:timestamp>
<xvrl:validator name="Saxon EE"
version="12.7"/>
<xvrl:creator name="XML Calabash"
version="3.0.5-SNAPSHOT"/>
<xvrl:document href="file:/woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/documents/xsd-document.xml"/>
</xvrl:metadata>
<xvrl:detection xmlns:s="http://saxon.sf.net/"
s:constraint-name="cvc-elt" s:constraint-clause="1"
s:constraint-reference="cvc-elt.1" s:schema-part="1"
severity="error" code="XQDY0084">
<xvrl:location href="file:/woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/documents/xsd-document.xml"
line="2" column="51"
xpath="/Q{}doc[1]"/>
<xvrl:message>Cannot validate <Q{}doc>: no element declaration available</xvrl:message>
</xvrl:detection>
<xvrl:digest valid="false"
fatal-error-count="0" error-count="1" warning-count="0"
info-count="0" unspecified-count="0"
fatal-error-codes="" error-codes="XQDY0084"
warning-codes="" info-codes=""
unspecified-codes="" worst="error"/>
</xvrl:report>
<cx:stack-trace>
<cx:stack-frame type="p:validate-with-xml-schema"
name="!validate-with-xml-schema"/>
<cx:stack-frame type="p:group" name="!group"/>
</cx:stack-trace>
</c:error>
</c:errors>
Schematron checks
<s:schema xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:t="http://xproc.org/ns/testsuite/3.0"
queryBinding="xslt2">
<s:ns prefix="c"
uri="http://www.w3.org/ns/xproc-step"/>
<s:pattern>
<s:rule context="/">
<s:assert test="c:errors">The pipeline root is not “c:errors”.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 10 Jun 2021, Achim Berndzen
- Added attribute 'queryBinding' to schematron's schema.
- 21 Jul 2019, Norman Walsh
- Initial publication