cache-005

Tests that the document can be removed from the cache.

Test is expected to pass.

The pipeline

<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
                xmlns:err="http://www.w3.org/ns/xproc-error" xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:t="http://xproc.org/ns/testsuite/3.0" version="3.0">
   <p:import href="https://xmlcalabash.com/ext/library/cache.xpl"/>
   <p:output port="result"/>
   <cx:cache-add name="cache-add"
                 href="https://xmlcalabash.com/does/not/exist.xml">
      <p:with-input>
         <does-so/>
      </p:with-input>
   </cx:cache-add>
   <cx:cache-delete name="cache-delete"
                    p:depends="cache-add" fail-if-not-in-cache="true"
                    href="https://xmlcalabash.com/does/not/exist.xml">
      <p:with-input>
         <irrelevant/>
      </p:with-input>
   </cx:cache-delete>
   <p:try>
      <p:xinclude depends="cache-delete">
         <p:with-input>
            <doc xmlns:xi="http://www.w3.org/2001/XInclude">
               <xi:include href="https://xmlcalabash.com/does/not/exist.xml"/>
            </doc>
         </p:with-input>
      </p:xinclude>
      <p:catch code="err:XC0029">
         <p:identity>
            <p:with-input>
               <correct/>
            </p:with-input>
         </p:identity>
      </p:catch>
   </p:try>
</p:declare-step>

Result

<correct xmlns:cx="http://xmlcalabash.com/ns/extensions"
         xmlns:err="http://www.w3.org/ns/xproc-error" xmlns:t="http://xproc.org/ns/testsuite/3.0"/>

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="correct">The document root is not correct.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

29 Nov 2024, Norm Tovey-Walsh
Created test.