label-elements 010 (AB)

Testing p:label-elements.

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" version="3.0">
   <p:output port="result"/>
   <p:input port="source">
      <doc>
         <div>
            <p>Some para.</p>
            <p>Some other para.</p>
         </div>
      </doc>
   </p:input>
   <p:label-elements match="p" attribute="text"
                     label="text()"/>
</p:declare-step>

Result

<doc xmlns:t="http://xproc.org/ns/testsuite/3.0">
   <div>
      <p text="Some para.">Some para.</p>
      <p text="Some other para.">Some other para.</p>
   </div>
</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:pattern>
      <s:rule context="/">
         <s:assert test="doc/div/p[1]/@text='Some para.'">Value of doc/div/p[1]/@text is not 'Some para.'</s:assert>
         <s:assert test="doc/div/p[2]/@text='Some other para.'">Value of doc/div/p[1]/@text is not 'Some other para.'</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

10 Jun 2021, Achim Berndzen
Added attribute 'queryBinding' to schematron's schema.
04 May 2019, Achim Berndzen
Ported test from 1.0 test suite.