XQuery Function Documentation

Search and Browse

http://expath.org/ns/zip

java:org.expath.exist.ZipModule

EXPath ZIP Module http://expath.org/spec/zip

zip:binary-entry

zip:binary-entry($href as xs:anyURI, $entry as xs:string) as xs:base64Binary

Extracts the binary stream from the file positioned at $entry within the ZIP file identified by $href and returns it as a Base64 item.

Parameters:
$hrefThe URI for locating the Zip file
$entryThe entry within the Zip file to address
Returns:
xs:base64Binary : The binary representation of the entry from the Zip file.

zip:entries

zip:entries($href as xs:anyURI) as node()

Returns a zip:file element that describes the hierarchical structure of the ZIP file identified by $href in terms of ZIP entries

Parameters:
$hrefThe URI for locating the Zip file
Returns:
node() : The document node containing a zip:entry

zip:html-entry

zip:html-entry($href as xs:anyURI, $entry as xs:string) as document-node()

Extracts the html file positioned at $entry within the ZIP file identified by $href, and returns a document node. Because an HTML document is not necessarily a well-formed XML document, an implementation may use a specific parser in order to produce an XDM document node, like [TagSoup] or [HTML Tidy]; the details of this process are implementation-defined.

Parameters:
$hrefThe URI for locating the Zip file
$entryThe entry within the Zip file to address
Returns:
document-node() : The document-node of the entry from the Zip file.

zip:text-entry

zip:text-entry($href as xs:anyURI, $entry as xs:string) as xs:string

Extracts the contents of the text file positioned at entry within the ZIP file identified by $href and returns it as a string.

Parameters:
$hrefThe URI for locating the Zip file
$entryThe entry within the Zip file to address
Returns:
xs:string : The string value of the entry from the Zip file.

zip:update

zip:update($href as xs:anyURI, $paths as xs:string+, $binaries as xs:base64Binary+) as xs:base64Binary?

Returns a copy of the zip file at $href, after replacing or adding each binary using the matching path/filename in $paths.

Parameters:
$hrefThe URI for locating the Zip file
$paths+a sequence of file paths
$binaries+a sequence of binaries matching the paths
Returns:
xs:base64Binary? : The new zipped data or the empty sequence if the numbers of $paths and $binaries are different

zip:xml-entry

zip:xml-entry($href as xs:anyURI, $entry as xs:string) as document-node()

Extracts the content from the XML file positioned at $entry within the ZIP file identified by $href and returns it as a document-node.

Parameters:
$hrefThe URI for locating the Zip file
$entryThe entry within the Zip file to address
Returns:
document-node() : The document-node of the entry from the Zip file.