Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added specific attributes for XML file reading

...

It's also possible to assign Windows INI file values to IzPack dynamic variables. INI files are 3-dimensional configuration files with key-value pairs which are divided into several sections, following a certain syntax.

Using a dynamic variable assignment from a certain entry of an INI file is recognized by using the attribute file in the variable definition along with the attribute type set to "ini".

...

Another facility of dynamic variable assignments is reading values from XML files using XPath queries. For the syntax of XPath see XML Path Language (XPath) for more information.

Using a dynamic variable assignment from a certain XML entry in a XML file is recognized by using the attribute file in the variable definition along with the attribute type set to "xml".

Specific attributes:

  • file
    The XML file path to read from.
  • type := "options" | "ini" | "xml" (optional, defaults to "options")
    The file type, must be "XML" to assume a XML file.
  • key
    The XPath path to the entry to read the value for.

Example:

Code Block
langxml
titleDynamic variable assignment from XML file contents
<dynamicvariables>

    <variable name="XMLReadTest.1" checkonce="true" ignorefailure="false"
              file="${INSTALL_PATH}/../old_installation/test.xml" type="xml"
              key="/installations/installation[path='/usr/local']/title[@lang='en']/text()"/>

    <variable name="XMLReadTest.2" checkonce="true" ignorefailure="false"
              file="${INSTALL_PATH}/../old_installation/test.xml" type="xml"
              key="//title[@lang='en']/text()"/>

</dynamicvariables>

...