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 port | Primary | Sequence | Content types |
|---|---|---|---|
| source | ✔ |
| Output port | Primary | Sequence | Content types |
|---|---|---|---|
| result | ✔ |
| Option name | Type | Default value |
|---|---|---|
| content-type | xs:string | '*/*' |
| fail-if-not-in-cache | xs:boolean | false() |
| href | xs:anyURI? | () |
<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
| Code | Description |
|---|---|
err:XI0030 | It is a
dynamic error (cxerr:XI0030) if the source document does
not have a base URI and the href option is not
provided. |
err:XI0038 | 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. |
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.
hrefThe URI to cache. Defaults to the source document URI.
fail-if-not-in-cacheDetermines whether the URI must already exist in the cache.
content-typeDetermines which content-type hits in the cache will be deleted.
Document properties
No properties are changed.