<?xml version="1.0" encoding="UTF-8"?>
<t:test expected="pass"
        xmlns:t="http://xproc.org/ns/testsuite/3.0">
   <t:info>
      <t:title>p:wrap-sequence 017</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2025-02-01</t:date>
            <t:author>
               <t:name>Norm Tovey-Walsh</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Tests for p:wrap-sequence (Partly ported from 1.0)</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Tests that setting an xml:base attribute changes the base URI.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step name="pipeline"
                      version="3.0"
                      xmlns:p="http://www.w3.org/ns/xproc">
         <p:output port="result"/>

         <p:wrap-sequence wrapper="sequence"
                          attributes="map{'seq': true(), 'xml:base': 'http://example.com/'}">
           <p:with-input>
             <doc/>
             <doc/>
             <doc/>
           </p:with-input>
         </p:wrap-sequence>
         <p:identity>
           <p:with-input select="p:document-properties(.)"/>
         </p:identity>
         <p:cast-content-type content-type="application/xml"/>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <s:schema queryBinding="xslt2"
                xmlns:s="http://purl.oclc.org/dsdl/schematron"
                xmlns="http://www.w3.org/1999/xhtml">
        <s:ns prefix="fn" uri="http://www.w3.org/2005/xpath-functions"/>
         <s:pattern>
            <s:rule context="/">
               <s:assert test="fn:map">Root element is not 'fn:map'.</s:assert>
               <s:assert test="fn:map/fn:string[@key='base-uri']
                               = 'http://example.com/'">The base URI is incorrect.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
</t:test>
