Tests that an error code in a namespace raised by an XSLT stylesheet is reflected correctly in the error document.
Test try-catch-004.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:ex="http://example.com/ns/step" xmlns:p="http://www.w3.org/ns/xproc" version="3.0">
<p:output port="result"/>
<p:try>
<p:xslt>
<p:with-input port="stylesheet" href="../documents/xslt-dynamic-error-ns.xsl"/>
<p:with-input port="source" href="../documents/xslt-dynamic-error-ns.xsl"/>
</p:xslt>
<p:catch>
<p:identity/>
</p:catch>
</p:try>
</p:declare-step>
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<s:ns prefix="c" uri="http://www.w3.org/ns/xproc-step"/>
<s:ns prefix="cx" uri="http://xmlcalabash.com/ns/extensions"/>
<s:pattern>
<s:rule context="/">
<s:assert test="c:errors">The document is wrong</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/c:errors">
<s:assert test="count(c:error) = 1">Wrong number of errors</s:assert>
<s:assert test="c:error/@code = 'err:XC0096'">Wrong error code</s:assert>
<s:assert test="c:error/@cause = 'cpfx:error-code'">Wrong error cause</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Created test.