XQuery Function Documentation

Search and Browse

http://exist-db.org/xquery/compression

java:org.exist.xquery.modules.compression.CompressionModule

A module for compression and decompression functions

compression:gzip

compression:gzip($data as xs:base64Binary) as xs:base64Binary?

GZip's data

Parameters:
$data The data to GZip
Returns:
xs:base64Binary?

compression:tar

compression:tar($sources as xs:anyType+, $use-collection-hierarchy as xs:boolean) as xs:base64Binary*

Tars nodes, resources and collections.

Parameters:
$sources+ The sequence of URI's and/or Entrys. If an URI points to a collection then the collection, its resources and sub-collections are zipped recursively. If URI points to file (available only to the DBA role.) then file or directory are zipped. An Entry takes the format <entry name="filename.ext" type="collection|uri|binary|xml|text" method="deflate|store">data</entry>. The method attribute is only effective for the compression:zip function.
$use-collection-hierarchy Indicates whether the Collection hierarchy (if any) should be preserved in the zip file.
Returns:
xs:base64Binary*

compression:tar

compression:tar($sources as xs:anyType+, $use-collection-hierarchy as xs:boolean, $strip-prefix as xs:string) as xs:base64Binary*

Tars nodes, resources and collections.

Parameters:
$sources+ The sequence of URI's and/or Entrys. If an URI points to a collection then the collection, its resources and sub-collections are zipped recursively. If URI points to file (available only to the DBA role.) then file or directory are zipped. An Entry takes the format <entry name="filename.ext" type="collection|uri|binary|xml|text" method="deflate|store">data</entry>. The method attribute is only effective for the compression:zip function.
$use-collection-hierarchy Indicates whether the Collection hierarchy (if any) should be preserved in the zip file.
$strip-prefix This prefix is stripped from the Entrys name
Returns:
xs:base64Binary*

compression:tar

compression:tar($sources as xs:anyType+, $use-collection-hierarchy as xs:boolean, $strip-prefix as xs:string, $encoding as xs:string) as xs:base64Binary*

Tars nodes, resources and collections.

Parameters:
$sources+ The sequence of URI's and/or Entrys. If an URI points to a collection then the collection, its resources and sub-collections are zipped recursively. If URI points to file (available only to the DBA role.) then file or directory are zipped. An Entry takes the format <entry name="filename.ext" type="collection|uri|binary|xml|text" method="deflate|store">data</entry>. The method attribute is only effective for the compression:zip function.
$use-collection-hierarchy Indicates whether the Collection hierarchy (if any) should be preserved in the zip file.
$strip-prefix This prefix is stripped from the Entrys name
$encoding This encoding to be used for filenames inside the compressed file
Returns:
xs:base64Binary*

compression:ungzip

compression:ungzip($gzip-data as xs:base64Binary) as xs:base64Binary?

UnGZip's data

Parameters:
$gzip-data The gzip data to uncompress.
Returns:
xs:base64Binary?

compression:untar

compression:untar($tar-data as xs:base64Binary, $entry-filter as function(*), $entry-filter-param as xs:anyType*, $entry-data as function(*), $entry-data-param as xs:anyType*) as item()*

UnTar all the resources/folders from the provided data by calling user defined functions to determine what and how to store the resources/folders

Parameters:
$tar-data The tar file data
$entry-filter A user defined function for filtering resources from the tar file. The function takes 3 parameters e.g. user:untar-entry-filter($path as xs:string, $data-type as xs:string, $param as item()*) as xs:boolean. $data-type may be 'resource' or 'folder'. $param is a sequence with any additional parameters, for example a list of extracted files. If the return type is true() it indicates the entry should be processed and passed to the entry-data function, else the resource is skipped.
$entry-filter-param* A sequence with an additional parameters for filtering function.
$entry-data A user defined function for storing an extracted resource from the tar file. The function takes 4 parameters e.g. user:untar-entry-data($path as xs:string, $data-type as xs:string, $data as item()?, $param as item()*). Or a user defined function wich returns path for storing an extracted resource from the tar file. The function takes 3 parameters e.g. user:entry-path($path as xs:string, $data-type as xs:string, $param as item()*) as xs:anyURI. $data-type may be 'resource' or 'folder'. $param is a sequence with any additional parameters
$entry-data-param* A sequence with an additional parameters for storing function.
Returns:
item()*

compression:untar

compression:untar($tar-data as xs:base64Binary, $entry-filter as function(*), $entry-filter-param as xs:anyType*, $entry-data as function(*), $entry-data-param as xs:anyType*, $encoding as xs:string) as item()*

UnTar all the resources/folders from the provided data by calling user defined functions to determine what and how to store the resources/folders

Parameters:
$tar-data The tar file data
$entry-filter A user defined function for filtering resources from the tar file. The function takes 3 parameters e.g. user:untar-entry-filter($path as xs:string, $data-type as xs:string, $param as item()*) as xs:boolean. $data-type may be 'resource' or 'folder'. $param is a sequence with any additional parameters, for example a list of extracted files. If the return type is true() it indicates the entry should be processed and passed to the entry-data function, else the resource is skipped.
$entry-filter-param* A sequence with an additional parameters for filtering function.
$entry-data A user defined function for storing an extracted resource from the tar file. The function takes 4 parameters e.g. user:untar-entry-data($path as xs:string, $data-type as xs:string, $data as item()?, $param as item()*). Or a user defined function wich returns path for storing an extracted resource from the tar file. The function takes 3 parameters e.g. user:entry-path($path as xs:string, $data-type as xs:string, $param as item()*) as xs:anyURI. $data-type may be 'resource' or 'folder'. $param is a sequence with any additional parameters
$entry-data-param* A sequence with an additional parameters for storing function.
$encoding The encoding to be used during uncompressing eg: UTF8 or Cp437 from https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html
Returns:
item()*

compression:unzip

compression:unzip($zip-data as xs:base64Binary, $entry-filter as function(*), $entry-filter-param as xs:anyType*, $entry-data as function(*), $entry-data-param as xs:anyType*) as item()*

UnZip all the resources/folders from the provided data by calling user defined functions to determine what and how to store the resources/folders

Parameters:
$zip-data The zip file data
$entry-filter A user defined function for filtering resources from the zip file. The function takes 3 parameters e.g. user:unzip-entry-filter($path as xs:string, $data-type as xs:string, $param as item()*) as xs:boolean. $data-type may be 'resource' or 'folder'. $param is a sequence with any additional parameters, for example a list of extracted files. If the return type is true() it indicates the entry should be processed and passed to the entry-data function, else the resource is skipped.
$entry-filter-param* A sequence with an additional parameters for filtering function.
$entry-data A user defined function for storing an extracted resource from the zip file. The function takes 4 parameters e.g. user:unzip-entry-data($path as xs:string, $data-type as xs:string, $data as item()?, $param as item()*). Or a user defined function which returns path for storing an extracted resource from the tar file. The function takes 3 parameters e.g. user:entry-path($path as xs:string, $data-type as xs:string, $param as item()*) as xs:anyURI. $data-type may be 'resource' or 'folder'. $param is a sequence with any additional parameters.
$entry-data-param* A sequence with an additional parameters for storing function.
Returns:
item()*

compression:unzip

compression:unzip($zip-data as xs:base64Binary, $entry-filter as function(*), $entry-filter-param as xs:anyType*, $entry-data as function(*), $entry-data-param as xs:anyType*, $encoding as xs:string) as item()*

UnZip all the resources/folders from the provided data by calling user defined functions to determine what and how to store the resources/folders

Parameters:
$zip-data The zip file data
$entry-filter A user defined function for filtering resources from the zip file. The function takes 3 parameters e.g. user:unzip-entry-filter($path as xs:string, $data-type as xs:string, $param as item()*) as xs:boolean. $data-type may be 'resource' or 'folder'. $param is a sequence with any additional parameters, for example a list of extracted files. If the return type is true() it indicates the entry should be processed and passed to the entry-data function, else the resource is skipped.
$entry-filter-param* A sequence with an additional parameters for filtering function.
$entry-data A user defined function for storing an extracted resource from the zip file. The function takes 4 parameters e.g. user:unzip-entry-data($path as xs:string, $data-type as xs:string, $data as item()?, $param as item()*). Or a user defined function which returns path for storing an extracted resource from the tar file. The function takes 3 parameters e.g. user:entry-path($path as xs:string, $data-type as xs:string, $param as item()*) as xs:anyURI. $data-type may be 'resource' or 'folder'. $param is a sequence with any additional parameters.
$entry-data-param* A sequence with an additional parameters for storing function.
$encoding The encoding to be used during uncompressing eg: UTF8 or Cp437 from https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html
Returns:
item()*

compression:zip

compression:zip($sources as xs:anyType+, $use-collection-hierarchy as xs:boolean) as xs:base64Binary*

Zips nodes, resources and collections.

Parameters:
$sources+ The sequence of URI's and/or Entrys. If an URI points to a collection then the collection, its resources and sub-collections are zipped recursively. If URI points to file (available only to the DBA role.) then file or directory are zipped. An Entry takes the format <entry name="filename.ext" type="collection|uri|binary|xml|text" method="deflate|store">data</entry>. The method attribute is only effective for the compression:zip function.
$use-collection-hierarchy Indicates whether the Collection hierarchy (if any) should be preserved in the zip file.
Returns:
xs:base64Binary*

compression:zip

compression:zip($sources as xs:anyType+, $use-collection-hierarchy as xs:boolean, $strip-prefix as xs:string) as xs:base64Binary*

Zips nodes, resources and collections.

Parameters:
$sources+ The sequence of URI's and/or Entrys. If an URI points to a collection then the collection, its resources and sub-collections are zipped recursively. If URI points to file (available only to the DBA role.) then file or directory are zipped. An Entry takes the format <entry name="filename.ext" type="collection|uri|binary|xml|text" method="deflate|store">data</entry>. The method attribute is only effective for the compression:zip function.
$use-collection-hierarchy Indicates whether the Collection hierarchy (if any) should be preserved in the zip file.
$strip-prefix This prefix is stripped from the Entrys name
Returns:
xs:base64Binary*

compression:zip

compression:zip($sources as xs:anyType+, $use-collection-hierarchy as xs:boolean, $strip-prefix as xs:string, $encoding as xs:string) as xs:base64Binary*

Zips nodes, resources and collections.

Parameters:
$sources+ The sequence of URI's and/or Entrys. If an URI points to a collection then the collection, its resources and sub-collections are zipped recursively. If URI points to file (available only to the DBA role.) then file or directory are zipped. An Entry takes the format <entry name="filename.ext" type="collection|uri|binary|xml|text" method="deflate|store">data</entry>. The method attribute is only effective for the compression:zip function.
$use-collection-hierarchy Indicates whether the Collection hierarchy (if any) should be preserved in the zip file.
$strip-prefix This prefix is stripped from the Entrys name
$encoding This encoding to be used for filenames inside the compressed file
Returns:
xs:base64Binary*