<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="xmlnt-001.xml"
        name="xmlnt-001.xml"
        expected="pass">
   <t:info>
      <t:title>xmlnt-001</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2025-09-03</t:date>
            <t:author>
               <t:name>Norm Tovey-Walsh</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Created test.</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Tests that XMLn’t works.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
                      xmlns:p="http://www.w3.org/ns/xproc"
                      name="main"
                      version="3.0">
         <p:output port="result" sequence="true"/>
         <p:identity>
            <p:with-input>
               <p:document href="../documents/xmlnt/simple.xml"
                           parameters="map { 'cx:xmlnt': 'entities' }"/>
            </p:with-input>
         </p:identity>
         <p:cast-content-type content-type="text/plain"/>
         <p:wrap-sequence wrapper="wrapper"/>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
         <s:pattern>
            <s:rule context="/">
               <s:assert test="wrapper">The root is wrong.</s:assert>
               <s:assert test="starts-with(wrapper, '&lt;doc a=')">The wrapper doesn’t wrap the doc</s:assert>
               <s:assert test="matches(wrapper, 'testing&#xA;\s+with a newline')">Attribute doesn’t have a newline</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="xmlnt-001.xml">
      <wrapper>&lt;doc a="testing
        with a newline"/&gt;</wrapper>
   </t:result>
</t:test>
