cast-content-type 031 (AB)

Tests that a c:data document is decoded if cast to Text. ISO charset

Test ab-cast-content-type-031.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: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="ISO-8859-1">Q29weSCp</c:data>
      </p:with-input>
   </p:cast-content-type>
   <p:wrap-sequence wrapper="result"/>
</p:declare-step>

Schematron validation


<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" 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.