A module for compression and decompression functions
compression:db-store-entry3($destination as xs:string?) as function(*)
Stores an entry to the database. Attempts to guard against exit attacks; If an exit attack is detected then the error `compression:archive-exit-attack is raised`.
$destination? | A path to a Collection in the database where the entry should be extracted. If the Collection does not exist it will be created. |
compression:db-store-entry4($destination as xs:string?) as function(*)
Stores an entry to the database. Attempts to guard against exit attacks; If an exit attack is detected then the error `compression:archive-exit-attack is raised`.
$destination? | A path to a Collection in the database where the entry should be extracted. If the Collection does not exist it will be created. |
compression:deflate($data as xs:base64Binary) as xs:base64Binary?
Deflate data (RFC 1950)
$data | The data to Deflate |
compression:deflate($data as xs:base64Binary, $raw as xs:boolean) as xs:base64Binary?
Deflate data (RFC 1951)
$data | The data to Deflate |
$raw | If true, create raw deflate data that is not wrapped inside zlib header and checksum. |
compression:fs-store-entry3($destination as xs:string?) as function(*)
Stores an entry to the filesystem. This method is only available to the DBA role. Attempts to guard against exit attacks; If an exit attack is detected then the error `compression:archive-exit-attack is raised`.
$destination? | A path to a directory on the filesystem where the entry should be extracted. If the path does not exist it will be created. |
compression:fs-store-entry4($destination as xs:string?) as function(*)
Stores an entry to the filesystem. This method is only available to the DBA role. Attempts to guard against exit attacks; If an exit attack is detected then the error `compression:archive-exit-attack is raised`.
$destination? | A path to a directory on the filesystem where the entry should be extracted. If the path does not exist it will be created. |
compression:gzip($data as xs:base64Binary) as xs:base64Binary?
GZip's data
$data | The data to GZip |
compression:inflate($inflate-data as xs:base64Binary) as xs:base64Binary?
Inflate data (RFC 1950)
$inflate-data | The inflate data to uncompress. |
compression:inflate($inflate-data as xs:base64Binary, $raw as xs:boolean) as xs:base64Binary?
Inflate data (RFC 1951)
$inflate-data | The inflate data to uncompress. |
$raw | If true, expect raw deflate data that is not wrapped inside zlib header and checksum. |
compression:no-filter($path as xs:string, $data-type as xs:string) as xs:boolean
Does not filter any entries.
$path | The path of the entry |
$data-type | The type of the entry, either 'directory' or 'resource'. |
compression:no-filter($path as xs:string, $data-type as xs:string, $param as item()*) as xs:boolean
Does not filter any entries.
$path | The path of the entry |
$data-type | The type of the entry, either 'directory' or 'resource'. |
$param* | One or more parameters. |
compression:tar($sources as xs:anyType+, $use-collection-hierarchy as xs:boolean) as xs:base64Binary*
Tars nodes, resources and collections.
$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. |
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.
$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 |
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.
$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 |
compression:ungzip($gzip-data as xs:base64Binary) as xs:base64Binary?
UnGZip's data
$gzip-data | The gzip data to uncompress. |
compression:untar($tar-data as xs:base64Binary, $entry-filter as function(*), $entry-data as function(*)) 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
$tar-data | The tar file data |
$entry-filter | A user defined function for filtering resources from the tar file. The function takes 2 parameters e.g. user:untar-entry-filter($path as xs:string, $data-type as xs:string) as xs:boolean. $data-type may be 'resource' or 'folder'. 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. If you wish to extract all resources you can use the provided compression:no-filter#2 function. |
$entry-data | A user defined function for storing an extracted resource from the tar file. The function takes 3 parameters e.g. user:untar-entry-data($path as xs:string, $data-type as xs:string, $data as item()?). Or a user defined function which returns a db 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'. Functions for storing the entries to a folder on the filesystem or a collection in the database provided by compression:fs-store-entry3($dest) and compression:db-store-entry3($dest). |
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
$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. If you wish to extract all resources you can use the provided compression:no-filter#3 function. |
$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 which returns a db 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 parametersFunctions for storing the entries to a folder on the filesystem or a collection in the database provided by compression:fs-store-entry4($dest) and compression:db-store-entry4($dest). |
$entry-data-param* | A sequence with an additional parameters for storing function. |
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
$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. If you wish to extract all resources you can use the provided compression:no-filter#3 function. |
$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 which returns a db 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 parametersFunctions for storing the entries to a folder on the filesystem or a collection in the database provided by compression:fs-store-entry4($dest) and compression:db-store-entry4($dest). |
$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 |
compression:unzip($zip-data as xs:base64Binary, $entry-filter as function(*), $entry-data as function(*)) 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
$zip-data | The zip file data |
$entry-filter | A user defined function for filtering resources from the zip file. The function takes 2 parameters e.g. user:unzip-entry-filter($path as xs:string, $data-type as xs:string) as xs:boolean. $data-type may be 'resource' or 'folder'. 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. If you wish to extract all resources you can use the provided compression:no-filter#2 function. |
$entry-data | A user defined function for storing an extracted resource from the zip file. The function takes 3 parameters e.g. user:unzip-entry-data($path as xs:string, $data-type as xs:string, $data as item()?). Or a user defined function which returns a db path for storing an extracted resource from the zip 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'. Functions for storing the entries to a folder on the filesystem or a collection in the database provided by compression:fs-store-entry3($dest) and compression:db-store-entry3($dest). |
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
$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. If you wish to extract all resources you can use the provided compression:no-filter#3 function. |
$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 a db path for storing an extracted resource from the zip 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. Functions for storing the entries to a folder on the filesystem or a collection in the database provided by compression:fs-store-entry4($dest) and compression:db-store-entry4($dest). |
$entry-data-param* | A sequence with an additional parameters for storing function. |
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
$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. If you wish to extract all resources you can use the provided compression:no-filter#3 function. |
$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 a db path for storing an extracted resource from the zip 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. Functions for storing the entries to a folder on the filesystem or a collection in the database provided by compression:fs-store-entry4($dest) and compression:db-store-entry4($dest). |
$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 |
compression:zip($sources as xs:anyType+, $use-collection-hierarchy as xs:boolean) as xs:base64Binary*
Zips nodes, resources and collections.
$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. |
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.
$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 |
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.
$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 |