p:wrap 009 (AB)

Tests p:wrap

Test ab-wrap-009.xml is expected to pass.

The pipeline


<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="pipeline" version="3.0">
   <p:output port="result"/>
   <p:wrap match="section" wrapper="foo">
      <p:with-input>
         <doc>
            <section>
               <title>some title</title>
               <section>
                  <title>some title</title>
                  <section>
                     <title>some title</title>
                  </section>
                  <section>
                     <title>some title</title>
                  </section>
               </section>
            </section>
         </doc>
      </p:with-input>
   </p:wrap>
</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">Root element is not 'doc'.</s:assert>
         <s:assert test="doc/foo">Element 'doc' does not have a child 'foo'.</s:assert>
         <s:assert test="doc/foo/section">Element 'doc/foo' does not have child 'section'.</s:assert>
         <s:assert test="doc/foo/section/title">Element 'doc/foo/section' does not have child 'title'.</s:assert>
         <s:assert test="doc/foo/section/foo">Element 'doc/foo/section' does not have child 'foo'.</s:assert>
         <s:assert test="doc/foo/section/foo/section">Element 'doc/foo/section/foo' does not have child 'section'.</s:assert>
         <s:assert test="doc/foo/section/foo/section/title">Element 'doc/foo/section/foo/section' does not have child 'title'.</s:assert>
         <s:assert test="count(doc/foo/section/foo/section/foo)=2">Element 'doc/foo/section/foo/section' does not have two child elements 'foo'.</s:assert>
         <s:assert test="count(doc/foo/section/foo/section/foo/section)=2">Element 'doc/foo/section/foo/section' does not have two child elements 'foo/section'.</s:assert>
         <s:assert test="count(doc/foo/section/foo/section/foo/section/title)=2">Element 'doc/foo/section/foo/section' does not have two child elements 'foo/section/title'.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

10 Jun 2021, Achim Berndzen

Added attribute 'queryBinding' to schematron's schema.

25 Aug 2019, Achim Berndzen

Tests for p:wrap (Partly ported from 1.0)