Testing p:label-elements.
Test ab-label-elements-012.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>
<p att="val1"/>
<p/>
<p att="val2"/>
</doc>
</p:input>
<p:label-elements match="p" attribute="att" replace="false"/>
</p:declare-step>
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<s:pattern>
<s:rule context="/">
<s:assert test="doc/p[1]/@att='val1'">Value of doc/p[1]/@att is not 'val1'.</s:assert>
<s:assert test="doc/p[2]/@att='_2'">Value of doc/p[2]/@att is not '_2'.</s:assert>
<s:assert test="doc/p[3]/@att='val2'">Value of doc/p[3]/@att is not 'val2'.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Added attribute 'queryBinding' to schematron's schema.
Additional test with replace="false"