nw-import-functions-002b
Tests p:import-functions: tests limiting XQuery imports by namespace.
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"
xmlns:test="http://xproc.org/ns/testsuite/3.0/function-test"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0">
<p:import-functions href="../documents/xquery-library.xq"
namespace="http://example.com/1 http://example.com/1"
content-type="application/xquery"/>
<p:output port="result"/>
<p:choose>
<p:when test="function-lookup(xs:QName('test:function1'), 0)">
<p:identity>
<p:with-input>
<incorrect/>
</p:with-input>
</p:identity>
</p:when>
<p:otherwise>
<p:identity>
<p:with-input>
<correct/>
</p:with-input>
</p:identity>
</p:otherwise>
</p:choose>
</p:declare-step>
Result
<correct xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:test="http://xproc.org/ns/testsuite/3.0/function-test" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
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="/">
<s:assert test="correct">The document root is not correct.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 10 Jan 2025, Achim Berndzen
- Marked feature on test.
- 06 Dec 2024, Norm Tovey-Walsh
- Adapted so that it can fail dynamically.
- 06 Dec 2024, Norm Tovey-Walsh
- Tests for p:import-functions.