lookup-uri-001
Tests that lookup URI returns the original URI if there’s no catalog.
Test is expected to pass.
Catalog
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
xmlns:t="http://xproc.org/ns/testsuite/3.0" prefer="public">
<uri name="http://example.com/some/uri"
uri="http://somewhere-else.example.com/"/>
</catalog>
The pipeline
<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"
xmlns:t="http://xproc.org/ns/testsuite/3.0" version="3.0">
<p:output port="result"/>
<p:identity>
<p:with-input>
<doc>{p:lookup-uri("http://example.com/some/uri")}</doc>
</p:with-input>
</p:identity>
</p:declare-step>
Result
<doc xmlns:cx="http://xmlcalabash.com/ns/extensions"
xmlns:err="http://www.w3.org/ns/xproc-error" xmlns:t="http://xproc.org/ns/testsuite/3.0">http://somewhere-else.example.com/</doc>
Schematron checks
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron"
xmlns:t="http://xproc.org/ns/testsuite/3.0" queryBinding="xslt2">
<s:ns prefix="fn"
uri="http://www.w3.org/2005/xpath-functions"/>
<s:pattern>
<s:rule context="/">
<s:assert test="doc">The result isn’t doc.</s:assert>
<s:assert test="doc = 'http://somewhere-else.example.com/'">The result is wrong.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 25 Jan 2025, Norm Tovey-Walsh
- Created test.