with-input-select-001

Test select on p:with-input select="."

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:identity>
      <p:with-input select=".">
         <doc>
            <element1 att="att"/>
            
                        A text node
                        
                  <element2/>
         </doc>
      </p:with-input>
   </p:identity>
</p:declare-step>

Result

<doc xmlns:t="http://xproc.org/ns/testsuite/3.0">
   <element1 att="att"/>
   
                        A text node
                        
                  <element2/>
</doc>

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="count(*) = 1">Document does not have exactly one child element.</s:assert>
         <s:assert test="count(doc)=1">Root element is not named 'doc'.</s:assert>
      </s:rule>
      <s:rule context="/doc">
         <s:assert test="count(*) = 2">Root element does not have 2 child elements.</s:assert>
         <s:assert test="*[1]/name()='element1'">First child element is not called 'element1'.</s:assert>
         <s:assert test="*[2]/name()='element2'">Second child element is not called 'element2'.</s:assert>
         <s:assert test="count(comment())=1">Root element does not have one comment as child.</s:assert>
         <s:assert test="count(processing-instruction(target))=1"/>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

10 Jun 2021, Achim Berndzen
Added attribute 'queryBinding' to schematron's schema.
02 Feb 2018, Achim Berndzen
added new tests