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 passing

Schematron validation


<s:schema xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <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'.&gt;</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

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)