<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="nw-wrap-001.xml"
        name="nw-wrap-001.xml"
        expected="pass">
   <t:info>
      <t:title>p:wrap 001 (NW)</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2026-01-10</t:date>
            <t:author>
               <t:name>Norm Tovey-Walsh</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Initial commit</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Tests that p:wrap always produces application/xml, even when the
  input is some other content type.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="pipeline" version="3.0">
         <p:output port="result"/>
         <p:wrap match="element" wrapper="wrapper">
            <p:with-input>
               <p:inline content-type="image/svg+xml">
                  <svg xmlns="http://www.w3.org/2000/svg">
                     <rect x="10" y="10" width="20" height="20" fill="red"/>
                  </svg>
               </p:inline>
            </p:with-input>
         </p:wrap>
         <p:cast-content-type content-type="application/xml" name="properties">
            <p:with-input select="p:document-properties(.)"/>
         </p:cast-content-type>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <s:schema xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://purl.oclc.org/dsdl/schematron"
                queryBinding="xslt2">
         <s:ns prefix="map" uri="http://www.w3.org/2005/xpath-functions"/>
         <s:pattern>
            <s:rule context="/">
               <s:assert test="map:map">Root element is not 'map'.</s:assert>
            </s:rule>
         </s:pattern>
         <s:pattern>
            <s:rule context="/map:map">
               <s:assert test="map:string[@key='content-type'] = 'application/xml'">Incorrect content type.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="nw-wrap-001.xml">
      <map xmlns="http://www.w3.org/2005/xpath-functions">
         <string key="content-type">application/xml</string>
         <string key="base-uri">file:/woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/tests/nw-wrap-001.xml</string>
      </map>
   </t:result>
</t:test>
