The properties from the configuration update are merged into the configuration in the following way:
If property does not exist in the configuration, it is added.
If property exists in the configuration, and it is not a leaf property, then there is no change in the configuration for this property element (except the case, when merge attribute is specified, see below).
If the property exists, and it is the leaf property, it is replaced (except the case when merge property is specified, see below).
Every property element may have the following attributes:
List of the platforms ( win, linux, mac) to which the property should apply. If the attribute is not mentioned, then it is applied for every platform. Example:
<file-handler-list> <file-handler> <extension>pdf</extension> <executable platform="linux">/usr/bin/xpdf</executable> <executable platform="win">C:\Program Files\Adobe\Acrobat 5.0\Acrobat\acrobat.exe</executable> </file-handler> </file-handler-list>
The above configuration fragment associates PDF files with /usr/bin/xpdf viewer on Linux platforms, and C:\Program Files\Adobe\Acrobat 5.0\Acrobat\acrobat.exe on Windows.
This attribute specifies how the property merges into the configuration. It may have following values:
Replaces property in the configuration.
Removes property from the configuration. The value is ignored.
Append the property to the element list of the parent node.
Prepend the property to the element list of the parent node.
Valid for leaf nodes only. Append the text value of the property to the existing text value.
Valid for leaf nodes only. Prepend the text value of the property to the existing text value.
merge attribute applies only to the property where it is specified, and NOT to the child properties. For example, if you need to add a few < example>'s to the Serna configuration, you should specify merge="append" attribute on both < example> elements, not on containing < examples> element.
If there are multiple properties with the same name (property list), this specifies the number of the target property (counting from 1).
Properties may contain Serna variables, e.g:
<xml-catalogs> <files merge="prepend-string" platform="linux mac">$$SERNA_XML/ideadb/ideadb-1.0b/catalog.xml:</files> </xml-catalogs>
Note, that variable $SERNA_XML is escaped with extra $ sign.