p:unescape-markup 007 (AB)

Tests p:unescape-markup

Test ab-unescape-markup-007.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:unescape-markup namespace="http://www.example.org/ns/">
            <p:with-input port="source">
               <p:inline><wrapper xmlns=""><!-- comment --><?foo bar?><doc><p>foo</p></doc></wrapper></p:inline>
            </p:with-input>
         </p:unescape-markup>
      </p:declare-step>
   
MorganaXProc passing XML Calabash passing

Schematron validation


      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
         <s:ns uri="http://www.example.org/ns/" prefix="ex"/>
         <s:pattern>
             <s:rule context="/">
                <s:assert test="wrapper">Document element is not "wrapper".</s:assert>
                <s:assert test="wrapper/node()[1] instance of comment()">First child of wrapper should be a comment.</s:assert>
                <s:assert test="wrapper/comment()=' comment '">The comment is not ' comment '.</s:assert>
                <s:assert test="wrapper/node()[2] instance of processing-instruction()">Second child of wrapper should be a pi().</s:assert>
                <s:assert test="wrapper/processing-instruction()/name()='foo'">Name of pi() is not 'foo'.</s:assert>
                <s:assert test="wrapper/processing-instruction()='bar'">Text of pi() is not 'bar'.</s:assert>
                <s:assert test="wrapper/ex:doc">Element 'wrapper' does not have child 'doc'.</s:assert>
                <s:assert test="wrapper/ex:doc/ex:p">Element 'doc' does not have child 'p'.</s:assert>
                <s:assert test="wrapper/ex:doc/ex:p/text()='foo'">Text value of 'p' is not 'foo'.</s:assert>
              </s:rule>
         </s:pattern>
      </s:schema>
   

Revision history

23 Jun 2019, Achim Berndzen

Tests for p:unescape-markup (ported from 1.0 test suite)