p:escape-markup 004

Tests p:escape-markup: Comment and processing instructions are preserved on surrounding document.

Test ab-escape-markup-004.xml is expected to pass.

The pipeline


      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="pipeline" version="3.0">
         <p:output port="result"/>
         <p:escape-markup>
            <p:with-input>
               <p:inline>
                  
                  
                  <body-wrapper xmlns=""><doc/></body-wrapper>
                  
                  
               </p:inline>
            </p:with-input>
         </p:escape-markup>
         
         <p:wrap-sequence wrapper="wrapper"/>
      </p:declare-step>
   
MorganaXProc passing XML Calabash passing

Schematron validation


      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
         <s:pattern>
             <s:rule context="/">
                <s:assert test="wrapper">Document element is not wrapper.</s:assert>
                <s:assert test="count(wrapper/node())=11">Document element should have 11 children.</s:assert>
                <s:assert test="wrapper/node()[1] instance of text()">First child should be text.</s:assert>
                <s:assert test="wrapper/node()[2] instance of comment()">Second child should be comment.</s:assert>
                <s:assert test="wrapper/node()[4] instance of processing-instruction()">Forth child should be pi.</s:assert>
                <s:assert test="wrapper/node()[6] instance of element()">Sixth child should be element.</s:assert>
                <s:assert test="wrapper/node()[8] instance of comment()">Eight child should be comment.</s:assert>
                <s:assert test="wrapper/node()[10] instance of processing-instruction()">Tenth child should be pi.</s:assert>
                <s:assert test="wrapper/node()[11] instance of text()">Eleventh child should be text.</s:assert>
               </s:rule>
         </s:pattern>
      </s:schema>
   

Revision history

30 Jun 2019, Achim Berndzen

Fixed schematron tests to handle text nodes correctly.

23 Jun 2019, Achim Berndzen

Tests for p:escape-markup