Test for p:insert 011 (AB)

Tests p:insert on multiple positions on different levels.

Test ab-insert-011.xml is expected to pass.

The pipeline


<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.0">
   <p:output port="result"/>
   <p:insert match="a" position="first-child">
      <p:with-input>
         <doc>
            <a>
               <a>
                  <a/>
               </a>
            </a>
         </doc>
      </p:with-input>
      <p:with-input port="insertion">
         <b/>
      </p:with-input>
   </p:insert>
</p:declare-step>
MorganaXProc passing XML Calabash passing

Schematron validation


<s:schema xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <s:pattern>
      <s:rule context="/">
         <s:assert test="doc">The root element is not 'doc'.</s:assert>
         <s:assert test="doc/a">The root does not have a child 'a'.</s:assert>
         <s:assert test="doc/a/*[1]/name()='b'">The first child of doc/a is not 'b'.</s:assert>
         <s:assert test="doc/a/*[2]/name()='a'">The second child of doc/a is not 'a'.</s:assert>
         <s:assert test="doc/a/a/*[1]/name()='b'">The first child of doc/a/a is not 'b'.</s:assert>
         <s:assert test="doc/a/a/*[2]/name()='a'">The second child of doc/a/a is not 'a'.</s:assert>
         <s:assert test="doc/a/a/a/b">Element doc/a/a/a does not have a child 'b'.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

10 Jun 2021, Achim Berndzen

Added attribute 'queryBinding' to schematron's schema.

23 Mar 2019, Achim Berndzen

new tests.