1.15. Element `zip`
Prev | 1. Reference | Next

### 1.15. Element `zip`

    <zip
      archive = Path
    >
      Content: [ add ]+
    </zip>

    <add
      files = Glob pattern
      baseDir = Path : .
    />

Creates a zip archive located at `archive` containing the files specified by the `add` child elements.

See also jar.

Example: Let's suppose current working directory contains:

    /tmp$ ls -R
    doc.xml
    doc.xml~
    doc.xml.SAVE

    ./attachments:
    data1.bin
    data1.zip
    data2.bin
    data2.zip

    ./resources:
    logo.png
    chart1.jpeg

    <zip archive="all.zip">
      <add files="doc.xml" />
      <add files="resources/*" />
      <add files="misc/*" />
      <add files="*.bin" baseDir="attachments" />
    </zip>

The above `zip` element creates in current working directory, an archive called `all.zip`, containing:

    /tmp$ unzip -v all.zip
    doc.xml
    resources/
    resources/logo.png
    resources/chart1.jpeg
    data1.bin
    data2.bin

Note that non-existent directory `misc/` will not cause the `zip` element to stop its processing or to report a warning.

Unless used in XMLmind XML Editor Professional Edition, this element will cause its parent process command to be disabled.

Prev | Up | Next
1.14. Element `copy` | Home | 1.16. Element `jar`