cast-content-type 026 (AB)

Tests casting from a binary type to the same does not change anything.

Test is expected to pass.

The pipeline

<p:declare-step xmlns:map="http://www.w3.org/2005/xpath-functions/map"
                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="application/octet-stream"
                        name="caster">
      <p:with-input>
         <p:inline content-type="application/octet-stream"
                   document-properties="map{'base-uri' : 'http://xproc-test.org',                         'serialization' : map{'method' : 'adaptive'},                         'additional' : 'property'}">This is just a binary.</p:inline>
      </p:with-input>
   </p:cast-content-type>
   <p:cast-content-type content-type="application/xml">
      <p:with-input select="p:document-properties(.)"/>
   </p:cast-content-type>
</p:declare-step>

Result

<map xmlns="http://www.w3.org/2005/xpath-functions"
     xmlns:t="http://xproc.org/ns/testsuite/3.0">
   <string key="content-type">application/octet-stream</string>
   <string key="additional">property</string>
   <string key="base-uri">http://xproc-test.org</string>
   <map key="serialization">
      <string key="method">adaptive</string>
   </map>
</map>

Schematron checks

<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron"
          xmlns:t="http://xproc.org/ns/testsuite/3.0" queryBinding="xslt2">
   <s:ns prefix="fn"
         uri="http://www.w3.org/2005/xpath-functions"/>
   <s:pattern>
      <s:rule context="/">
         <s:assert test="fn:map">Root element does not have a child 'fn:map'.</s:assert>
         <s:assert test="fn:map/fn:string[@key='base-uri']='http://xproc-test.org'">The base-uri property is not correct.</s:assert>
         <s:assert test="fn:map/fn:string[@key='content-type']='application/octet-stream'">The content-type property is not correct.</s:assert>
         <s:assert test="fn:map/fn:string[@key='additional']='property'">The additional property is not correct.</s:assert>
         <s:assert test="fn:map/fn:map[@key='serialization']">There is no serialization property.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

10 Jun 2021, Achim Berndzen
Added attribute 'queryBinding' to schematron's schema.
27 Dec 2019, Achim Berndzen
Initial tests for the new iteration of p:cast-content-type