Tests p:xquery
Test ab-xquery-006.xml is expected to pass.
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="pipeline" version="3.0">
<p:output port="result"/>
<p:xquery>
<p:with-input port="source">
<p:inline document-properties="map{'base-uri' : 'http://xproc-test/primary'}">
<document>
<title>Some Title</title>
<para>Some paragraph.</para>
</document>
</p:inline>
<p:inline document-properties="map{'base-uri' : 'http://xproc-test/secondary'}">
<document>
<title>Some Other Title</title>
<para>Some other paragraph.</para>
</document>
</p:inline>
</p:with-input>
<p:with-input port="query">
<c:query xmlns:c="http://www.w3.org/ns/xproc-step">
<result>{{collection()}}</result>
</c:query>
</p:with-input>
</p:xquery>
</p:declare-step>
<s:schema xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<s:pattern>
<s:rule context="/">
<s:assert test="result">Root element is not 'result'.</s:assert>
<s:assert test="count(result/document)=2">Root element does not have 2 children 'document'.</s:assert>
</s:rule>
<s:rule context="document[1]">
<s:assert test="title/text()='Some Title'">Title of document[1] is not 'Some Title'.</s:assert>
<s:assert test="para/text()='Some paragraph.'">Para of document[1] is not 'Some paragraph.'</s:assert>
</s:rule>
<s:rule context="document[2]">
<s:assert test="title/text()='Some Other Title'">Title of document[2] is not 'Some Other Title'.</s:assert>
<s:assert test="para/text()='Some other paragraph.'">Para of document[2] is not 'Some other paragraph.'</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Added base-uri to source documents to make sure every doc in default collection has a different one.
Added attribute 'queryBinding' to schematron's schema.
Tests for p:xquery (Partly ported from 1.0)