Test for p:insert 001 (AB)

Tests p:insert with position 'first-child'

Test ab-insert-001.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="first-child">
                <p:with-input port="source">
                    <div xmlns="">
                        <p>First paragraph.</p>
                        <p>Middle paragraph.</p>
                        <p>Last paragraph.</p>
                <p:with-input port="insertion">
                    <p:inline><p xmlns="">New first paragraph.</p></p:inline>
MorganaXProc passing XML Calabash failing

Schematron validation

        <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
                <s:rule context="/">
                    <s:assert test="div">The document root is not 'div'.</s:assert>
                    <s:assert test="div/p[1]/text()='New first paragraph.'">The text of the first p is not 'New first paragraph'.</s:assert>
                    <s:assert test="div/p[2]/text()='First paragraph.'">The text of the second p is not 'First paragraph'.</s:assert>
                    <s:assert test="div/p[3]/text()='Middle paragraph.'">The text of the third p is not 'Middle paragraph'.</s:assert>
                    <s:assert test="div/p[4]/text()='Last paragraph.'">The text of the fourth p is not 'Last paragraph'.</s:assert>
                    <s:assert test="count(/div/p)=4">Root element does not have exactly four p-children.</s:assert>                    

Revision history

22 Mar 2019, Achim Berndzen

Ported tests from 1.0 test suite