cast-content-type 029 (AB)

Tests that a c:data document is decoded if cast to Text. Charset UTF-8

Test is expected to pass.

The pipeline

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:t="http://xproc.org/ns/testsuite/3.0" name="pipeline" version="3.0">
   <p:output port="result"/>
   <p:cast-content-type content-type="text/plain">
      <p:with-input>
         <c:data xmlns:c="http://www.w3.org/ns/xproc-step"
                 content-type="text/plain" encoding="base64" charset="UTF-8">Q29weSDCqQ==</c:data>
      </p:with-input>
   </p:cast-content-type>
   <p:wrap-sequence wrapper="result"/>
</p:declare-step>

Result

<result xmlns:t="http://xproc.org/ns/testsuite/3.0">Copy ©</result>

Schematron checks

<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron"
          xmlns:t="http://xproc.org/ns/testsuite/3.0" queryBinding="xslt2">
   <s:pattern>
      <s:rule context="/">
         <s:assert test="result">The root element is not 'result'.</s:assert>
         <s:assert test="result/text()='Copy ©'">The text is not correctly decoded.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

02 Feb 2025, Achim Berndzen
Test casting from c:data to Text.