Name

cx:cache-delete — Deletes documents from the runtime cache.

Synopsis

XML Calabash maintains a cache of documents. This step deletes a document from the cache.

Input portPrimarySequenceContent types
source✔   
Output portPrimarySequenceContent types
result✔   
Option nameTypeDefault value
content-typexs:string'*/*'
fail-if-not-in-cachexs:booleanfalse()
hrefxs:anyURI?()
This is an extension step; to use it, your pipeline must include its declaration. For example, by including the extension library with an import at the top of your pipeline:
<p:import href="https://xmlcalabash.com/ext/library/cache.xpl"/>
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
  |   <p:option name="href" as="xs:anyURI?" select="()"/>
  |   <p:option name="fail-if-not-in-cache" as="xs:boolean" select="false()"/>
  |   <p:option name="content-type" as="xs:string" select="'*/*'"/>
5 |   <p:input port="source"/>
  |   <p:output port="result"/>
  |</p:declare-step>
Errors
CodeDescription
err:XI0030It is a dynamic error (cxerr:XI0030) if the source document does not have a base URI and the href option is not provided.
err:XI0038It is a dynamic error (cxerr:XI0038) if the fail-if-not-in-cache option is true and the cache does not contains a document with the URI being cached.

Description

XML Calabash maintains a cache of documents, see cx:cache-add for a description of how this works. A pipeline can delete a document from the cache explicitly with cx:cache-delete. If the href option is provided, it is used as the URI for caching, otherwise the source document URI is used. It is a dynamic error (cxerr:XI0030) if the source document does not have a base URI and the href option is not provided.

Irrespective of the cache URI, the step simply copies its source document to the result port. (It does not change the document’s base URI, even if an href option is provided to the cx:cache-delete step.)

It is a dynamic error (cxerr:XI0038) if the fail-if-not-in-cache option is true and the cache does not contains a document with the URI being cached.

The cx:cache-delete step will only delete documents that match that content type. (Wildcards may be used for the media type and subtype).

Options

There are three options.

href

The URI to cache. Defaults to the source document URI.

fail-if-not-in-cache

Determines whether the URI must already exist in the cache.

content-type

Determines which content-type hits in the cache will be deleted.

Document properties

No properties are changed.