html-xml-001

Test default mapping of xml:* attributes in parsed HTML. The underlying Validator.nu parser mangles them into xmlU00003Aname for no obvious reason.

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"/>
   
   <p:load href="../documents/attributes.html"/>
</p:declare-step>

Result

<html xmlns:t="http://xproc.org/ns/testsuite/3.0">
   <head>
      <title>Test</title>
   </head>
   <body xml:base="http://example.com">
      <h1 xml:id="test">Test</h1>
      <pre xml:space="preserve"/>
   </body>
</html>

Schematron checks

<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron"
          xmlns:t="http://xproc.org/ns/testsuite/3.0" queryBinding="xslt2">
   <s:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
   <s:pattern>
      <s:rule context="/">
         <s:assert test="h:html">The root is wrong.</s:assert>
         <s:assert test="h:html/h:body">No body element.</s:assert>
         <s:assert test="h:html/h:body/h:h1">No h1 element.</s:assert>
         <s:assert test="h:html/h:body/h:pre">No pre element.</s:assert>
      </s:rule>
   </s:pattern>
   <s:pattern>
      <s:rule context="/h:html/h:body">
         <s:assert test="@xml:base">No xml:base attribute.</s:assert>
      </s:rule>
   </s:pattern>
   <s:pattern>
      <s:rule context="/h:html/h:body/h:h1">
         <s:assert test="@xml:id">No xml:id attribute.</s:assert>
      </s:rule>
   </s:pattern>
   <s:pattern>
      <s:rule context="/h:html/h:body/h:pre">
         <s:assert test="@xml:space">No xml:space attribute.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

31 Jan 2026, Norm Tovey-Walsh
Created test.