Test for p:insert 013 (AB)
Tests p:insert element as last child of document node.
Test is expected to pass.
The pipeline
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" version="3.0">
<p:output port="result"/>
<p:insert match="/" position="last-child">
<p:with-input>
<doc1/>
</p:with-input>
<p:with-input port="insertion">
<doc2/>
</p:with-input>
</p:insert>
<p:wrap-sequence wrapper="wrap"/>
</p:declare-step>
Result
<wrap xmlns:t="http://xproc.org/ns/testsuite/3.0">
<doc1/>
<doc2/>
</wrap>
Schematron checks
<s:schema xmlns="http://www.w3.org/1999/xhtml"
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="wrap">The root element is not 'wrap'.</s:assert>
<s:assert test="wrap/*[1]/name()='doc1'">The first child of root is not 'doc1'.</s:assert>
<s:assert test="wrap/*[2]/name()='doc2'">The second child of root is not 'doc2'.</s:assert>
<s:assert test="count(/wrap/*)=2">The root does not have exactly two children.</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.