p:wrap 003 (AB)

Tests p:wrap

Test ab-wrap-003.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="p:option" wrapper="p:option-wrapper" group-adjacent="local-name()">
            <p:with-input>
               <p:inline>
                  <p:wrap>
                     <p:option name="target" value="p:option"/>
                     <p:option name="name" value="option-wrapper"/>
                  </p:wrap>
               </p:inline>
            </p:with-input>
         </p:wrap>
      </p:declare-step>
   
MorganaXProc passing XML Calabash failing

Schematron validation


      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
         <s:ns prefix="p" uri="http://www.w3.org/ns/xproc"/>
         <s:pattern>
            <s:rule context="/">
               <s:assert test="p:wrap">Root element is not 'p:wrap'.</s:assert>
               <s:assert test="p:wrap/p:option-wrapper">Element 'p:wrap' should have a child 'p:option-wrapper'.></s:assert>
               <s:assert test="count(p:wrap/p:option-wrapper/p:option)=2">Element 'p:option-wrapper' does not have two children 'p:option'.</s:assert>
               <s:assert test="count(p:wrap/*)=1"> Element 'p:wrap' should have only one child element.</s:assert>               
            </s:rule>
         </s:pattern>
      </s:schema>
   

Revision history

25 Aug 2019, Achim Berndzen

Tests for p:wrap (Partly ported from 1.0)