Declare-step-016 (AB)

Checks scoping rules for step types: Inner declare shadows outer step names.

Test ab-declare-step-016.xml is expected to pass.

The pipeline


      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" type="dummy:step" version="3.0">
         <p:input port="source" sequence="true">
            <result xmlns=""/>
         </p:input>
         <p:output port="result"/>
         
         <p:declare-step type="dummy:step">
            <p:input port="source"/>
            <p:output port="result"/>
            
            <p:identity/>
         </p:declare-step>
         
         <p:variable name="prevloops" select="count(/*/*)"/>
        
         <p:if test="$prevloops != 3">
            <p:insert match="/*" position="last-child">
               <p:with-input port="insertion">
                  <entry xmlns=""/>
               </p:with-input>
            </p:insert>      
            <dummy:step xmlns:dummy="http://dummy"/>
         </p:if>         
      </p:declare-step>
   

Schematron validation


      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
         <s:pattern>
            <s:rule context="/">
               <s:assert test="result">The document root is not 'result'.</s:assert>
               <s:assert test="count(result/*)=1">Result does not have 1 child element.</s:assert>
               <s:assert test="count(result/entry)=1">Result does not have 1 child named 'entry'.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   

Revision history

02 May 2021, Achim Berndzen

New tests p:declare-step.