Changes

Jump to navigation Jump to search
169 bytes removed ,  21:04, 28 May 2012
=Functions=
==zipzip2:create==
{|
|-
| width='90' | '''Signatures'''
|{{Func|zipzip2:create|$entries as element(entry)*, $contents as item()*|xs:base64Binary}}<br />
|-
| '''Summary'''
|Creates a new ZIP archive from the specified entries and contents.<br/>The {{MonoCode|$entries}} elements contain meta information required to create new ZIP entries. Beside the mandatory entry name, optional attributes can be specified, which contain the timestamp, compression level and encoding of textual entries.An Example:<pre class="brush:xml"><entry last-modified='2011-11-11T11:11:11' compression-level='9' encoding='US-ASCII'>hello.txt</entry></pre>The actual {{MonoCode|$contents}} must be {{MonoCode|xs:string}} or {{MonoCode|xs:base64Binary}} items.
|-
| '''Errors'''
|{{Error|FOZ20001|#Errors}} the number of entries and contents differs.<br />{{Error|FOZ20002|#Errors}} (some of) the contents are not strings of type {{Code|xs:string}} or binaries{{Code|xs:base64Binary}}.<br />{{Error|FOZ20003|#Errors}} (some of) the entries elements contain invalid data.<br/>{{Error|FOZ20004|#Errors}} the specified encoding is invalid or not supported.<br/>{{Error|FOZ29999|#Errors}} archive processing failed for some other reason.
|-
| '''Examples'''
|The following function creates a file an archive {{Code|archive.zip}} with the one file {{Code|file.txt}} inside:<pre class="brush:xquery">zip:create( <file xmlns="http://expath.org/ns/zip" href="archive.zip"> <entry src="file.txt"/> </file>)</pre>The following function creates a file {{Code|archive.zip}}. It contains one file {{Code|readme}} with the content "{{Code|thanks}}":
<pre class="brush:xquery">
zipzip2:zip-filecreate( <entry>file xmlns="http://expath.org/ns/zip" href="archive.zip"> <entry name="readme">thankstxt</entry> </file>, 'Hello World')
</pre>
|}
[[Category:XQuery]]
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu