Try/catch 009
Make sure that an explicitly named output port works on p:try.
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" version="3.1">
<p:output port="result" sequence="true">
<p:pipe port="my-result" step="try-catch"/>
</p:output>
<p:try name="try-catch">
<p:output port="my-result" primary="true"
sequence="true"/>
<p:group>
<p:identity>
<p:with-input>
<p:inline exclude-inline-prefixes="#all">
<doc>Hello, world</doc>
</p:inline>
</p:with-input>
</p:identity>
</p:group>
<p:catch>
<p:output port="my-result" primary="true"
sequence="true"/>
<p:identity/>
</p:catch>
</p:try>
</p:declare-step>
Result
<doc xmlns:t="http://xproc.org/ns/testsuite/3.0">Hello, world</doc>
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:pattern>
<s:rule context="/doc">
<s:assert test=". = 'Hello, world'">The pipeline root is incorrect.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 12 Aug 2025, Norman Walsh
- Initial commit.