asciidoctor-005

Tests that Asciidoctor creates several paragraphs of HTML5.

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:import href="https://xmlcalabash.com/ext/library/asciidoctor.xpl"/>
   <p:output port="result" sequence="true"/>
   <cx:asciidoctor backend="html5">
      <p:with-input>
         <p:inline content-type="text/plain">
This is a paragraph.

So is this.

And this.
      </p:inline>
      </p:with-input>
   </cx:asciidoctor>
   <p:wrap-sequence wrapper="wrapper"/>
</p:declare-step>

Result

<wrapper xmlns:t="http://xproc.org/ns/testsuite/3.0">
   <div xmlns="http://www.w3.org/1999/xhtml"
        xmlns:xl="http://www.w3.org/1999/xlink" class="paragraph">
      <p>This is a paragraph.</p>
   </div>
   <div xmlns="http://www.w3.org/1999/xhtml"
        xmlns:xl="http://www.w3.org/1999/xlink" class="paragraph">
      <p>So is this.</p>
   </div>
   <div xmlns="http://www.w3.org/1999/xhtml"
        xmlns:xl="http://www.w3.org/1999/xlink" class="paragraph">
      <p>And this.</p>
   </div>
</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:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
   <s:pattern>
      <s:rule context="/">
         <s:assert test="wrapper">No wrapper</s:assert>
         <s:assert test="count(wrapper/h:div) = 3">Wrong number of paragraphs.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

21 Feb 2025, Norm Tovey-Walsh
Created test.