Testing p:label-elements.
Test ab-label-elements-003.xml is expected to pass.
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.0">
<p:output port="result"/>
<p:input port="source">
<doc xml:base="http://example.com/base/">
<chap xml:base="http://example.com/base/chaps/">
<para>...</para>
</chap>
<chap>
<para>...</para>
</chap>
</doc>
</p:input>
<p:label-elements label="concat("http://foo.com/", $p:index)" attribute="xml:base" match="chap"/>
</p:declare-step>
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<s:pattern>
<s:rule context="/">
<s:assert test="doc">The document root is not 'doc'</s:assert>
<s:assert test="base-uri(doc)='http://example.com/base/'">The base-uri of doc is not 'http://example.com/base/'.</s:assert>
<s:assert test="doc/@xml:base='http://example.com/base/'">doc/@xml:base is not 'http://example.com/base/'.</s:assert>
<s:assert test="doc/chap[1]">Root element does not have a child 'chap'.</s:assert>
<s:assert test="base-uri(doc/chap[1])='http://foo.com/1'">The base-uri of chap[1] is not 'http://foo.com/1'.</s:assert>
<s:assert test="doc/chap[1]/@xml:base='http://foo.com/1'">The @xml:base of chap[1] is not 'http://foo.com/1'.</s:assert>
<s:assert test="doc/chap[1]/para/text()='...'">Element 'chap[1]' does not have a para child with '...'.</s:assert>
<s:assert test="doc/chap[2]">Root element does not have two children 'chap'.</s:assert>
<s:assert test="base-uri(doc/chap[2])='http://foo.com/2'">The base-uri of chap[2] is not 'http://foo.com/2'.</s:assert>
<s:assert test="doc/chap[2]/@xml:base='http://foo.com/2'">The @xml:base of chap[2] is not 'http://foo.com/2'.</s:assert>
<s:assert test="doc/chap[2]/para/text()='...'">Element 'chap[2]' does not have a para child with '...'.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Added attribute 'queryBinding' to schematron's schema.
Ported test from 1.0 test suite