With-input-select 001

Test with-input-select-001.xml is expected to pass.

The pipeline

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" version="3.0">
  <p:output port="result" sequence="true"/>
  <p:option name="blank" select="''"/>
  <p:option name="class" select="concat($blank, 'b')"/>

  <p:identity>
    <p:with-input port="source" select="//c:chapter[@class=$class]">
      <p:inline>
        <document xmlns="http://www.w3.org/ns/xproc-step" xmlns="http://www.w3.org/ns/xproc-step">
          <chapter xmlns="http://www.w3.org/ns/xproc-step" class="a">one</chapter>
          <chapter xmlns="http://www.w3.org/ns/xproc-step" class="a">two</chapter>
          <chapter xmlns="http://www.w3.org/ns/xproc-step" class="b">three</chapter>
        </document>
      </p:inline>
    </p:with-input>
  </p:identity>

  <p:wrap-sequence wrapper="c:result"/>
</p:declare-step>
MorganaXProc passing XML Calabash passing

Schematron validation


      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
         <s:ns prefix="c" uri="http://www.w3.org/ns/xproc-step"/>
         <s:pattern>
            <s:rule context="/*">
               <s:assert test="self::c:result">The pipeline root is not c:result.</s:assert>
               <s:assert test="count(c:chapter) = 1">There should be 1 chapter.</s:assert>
               <s:assert test="c:chapter = 'three'">The value should be three.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   

Revision history

29 Sep 2017 11:02, Norman Walsh

Add tests for @select on p:with-input