p:wrap-sequence 016

Testing the new (in 3.1) attributes option on p:wrap-sequence

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" name="pipeline" version="3.0">
   <p:output port="result"/>
   <p:wrap-sequence wrapper="sequence"
                    attributes="map{'seq': true()}">
      <p:with-input>
         <doc/>
         <doc/>
         <doc/>
      </p:with-input>
   </p:wrap-sequence>
</p:declare-step>

Result

<sequence xmlns:t="http://xproc.org/ns/testsuite/3.0"
          seq="true">
   <doc/>
   <doc/>
   <doc/>
</sequence>

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="sequence">Root element is not 'sequence'.</s:assert>
      </s:rule>
   </s:pattern>
   <s:pattern>
      <s:rule context="/sequence">
         <s:assert test="count(*) = 3">Wrong number of children.</s:assert>
         <s:assert test="@seq = 'true'">The seq attribute is incorrect.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

01 Feb 2025, Norm Tovey-Walsh
Tests for p:wrap-sequence (Partly ported from 1.0)