Declare-step-015 (AB)
Checks the outer pipeline is visible for recursive call.
Test is expected to pass.
The pipeline
<p:declare-step xmlns:dummy="http://dummy"
xmlns:err="http://www.w3.org/ns/xproc-error" xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" type="dummy:step" version="3.0">
<p:input port="source" sequence="true">
<result/>
</p:input>
<p:output port="result"/>
<p:variable name="prevloops" select="count(/*/*)"/>
<p:if test="$prevloops != 3">
<p:insert match="/*" position="last-child">
<p:with-input port="insertion">
<entry/>
</p:with-input>
</p:insert>
<dummy:step/>
</p:if>
</p:declare-step>
Result
<result xmlns:dummy="http://dummy"
xmlns:err="http://www.w3.org/ns/xproc-error" xmlns:t="http://xproc.org/ns/testsuite/3.0">
<entry/>
<entry/>
<entry/>
</result>
Schematron checks
<s:schema xmlns:err="http://www.w3.org/ns/xproc-error"
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="result">The document root is not 'result'.</s:assert>
<s:assert test="count(result/*)=3">Result does not have 3 child elements.</s:assert>
<s:assert test="count(result/entry)=3">Result does not have 3 children named 'entry'.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 10 Jun 2021, Achim Berndzen
- Added attribute 'queryBinding' to schematron's schema.
- 02 May 2021, Achim Berndzen
- New tests p:declare-step.