p:unescape-markup 005 (AB)

Tests p:unescape-markup

Test ab-unescape-markup-005.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=""><doc><p>foo</p></doc><doc><p>foo</p></doc></wrapper></p:inline>
            </p:with-input>
         </p:unescape-markup>
      </p:declare-step>
   
MorganaXProc passing XML Calabash failing

Schematron validation


      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
         <s:ns uri="http://www.example.org/ns/" prefix="ex"/>
         <s:ns uri="http://www.w3.org/ns/xproc-step" prefix="c"/>
         <s:pattern>
             <s:rule context="/">
                <s:assert test="wrapper">Document element is not "wrapper".</s:assert>
                <s:assert test="count(wrapper/ex:doc)=2">There should be two ex:doc elements in wrapper.</s:assert>
                <s:assert test="empty(prefix-from-QName(wrapper/ex:doc[1]/node-name()))">Element 'doc'[1] should not have a prefix.</s:assert>
                <s:assert test="empty(prefix-from-QName(wrapper/ex:doc[2]/node-name()))">Element 'doc'[2] should not have a prefix.</s:assert>
                <s:assert test="count(wrapper/ex:doc/ex:p)=2">There should be two ex:p elements in ex:doc.</s:assert>
                <s:assert test="empty(prefix-from-QName(wrapper/ex:doc/ex:p[1]/node-name()))">Element 'p'[1] should not have a prefix.</s:assert>
                <s:assert test="empty(prefix-from-QName(wrapper/ex:doc/ex:p[2]/node-name()))">Element 'p'[2] should not have a prefix.</s:assert>
                <s:assert test="wrapper/ex:doc[1]/ex:p='foo'">First 'p' does not have text 'foo'.</s:assert>
                <s:assert test="wrapper/ex:doc[2]/ex:p='foo'">Second 'p' does not have text '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)