Test for p:insert 007 (AB)

Tests p:insert document as last child.

Test ab-insert-007.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="div" position="last-child">
                <p:with-input port="source">
                    <doc xmlns="">
                            <p>First paragraph.</p>
                            <p>Middle paragraph.</p>
                            <p>Last paragraph.</p>
                <p:with-input port="insertion">
                    <p xmlns="">New after paragraph.</p>
MorganaXProc passing XML Calabash passing

Schematron validation

        <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
                <s:rule context="/">
                    <s:assert test="doc">The root element is not 'doc'.</s:assert>
                    <s:assert test="doc/div">Root element does not have child element 'div'.</s:assert>
                    <s:assert test="doc/div/p[1]='First paragraph.'">p[1] is not 'First paragraph.'.</s:assert>
                    <s:assert test="doc/div/p[2]='Middle paragraph.'">p[2] is not 'Middle paragraph.'.</s:assert>
                    <s:assert test="doc/div/p[3]='Last paragraph.'">p[3] is not 'Last paragraph.'.</s:assert>
                    <s:assert test="doc/div/p[4]='New after paragraph.'">p[4] is not 'New after paragraph.'.</s:assert>
                    <s:assert test="count(doc/div/p)=4">Element 'div' does not have exactly 4 p children.</s:assert>

Revision history

22 Mar 2019, Achim Berndzen

Ported tests from 1.0 test suite