xmlnt-004

Tests that XMLn’t works.

Test is expected to pass.

The pipeline

<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
                xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:t="http://xproc.org/ns/testsuite/3.0" name="main" version="3.0">
   <p:output port="result" sequence="true"/>
   <p:load href="../documents/xmlnt/eparsed.xml"
           parameters="map { 'cx:xmlnt': 'attributes' }"/>
   <p:cast-content-type content-type="text/plain"/>
   <p:wrap-sequence wrapper="wrapper"/>
</p:declare-step>

Result

<wrapper xmlns:t="http://xproc.org/ns/testsuite/3.0"><wrapper><doc a="testing
        with a newline"/>
</wrapper></wrapper>

Schematron checks

<s:schema 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="wrapper">The root is wrong.</s:assert>
         <s:assert test="starts-with(wrapper, '<wrapper><doc a=')">The wrapper doesn’t wrap the doc</s:assert>
         <s:assert test="matches(wrapper, 'testing
\s+with a newline')">Attribute doesn’t have a newline</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

03 Sep 2025, Norm Tovey-Walsh
Created test.