InstallAnywhere 2020
You can use the Read/Modify XML File action to modify an XML file on the target system.
Note • To perform complex modifications of an XML file, you can use multiple Read/Modify XML File actions. See Performing Complex XML File Modifications.
Properties Tab
The Properties tab of the Read/Modify XML File action customizer includes the following options:
Option |
Description |
||||||||||||
Installed File |
Select this option if you want the installer to modify a file the installer deploys on the target system. Click the Choose Target button to open the Read/Modify XML File dialog box and select the installed file you want the installer to modify. Available only in the Install and Post-Install sequences. |
||||||||||||
Existing File |
Select this option if you want the installer to modify a file that already exists on the target system. Enter the name of the file in the text box. |
||||||||||||
Read value |
Select this option if you want the installer to read a value in the specified XML file. If you choose this option, the following additional options are listed:
Note • The name of the Tag can be specified along with its occurrence using the format of tagname{occurrence#}, such as book{2}, where occurrence is a zero based occurrence of the tag book. |
||||||||||||
Replace value |
Select this option if you want the installer to search for a specific value in the XML file and replace it with a replacement value. If you choose this option, the following additional options are listed:
Note • The name of the Tag can be specified along with its occurrence using the format of tagname{occurrence#}, such as book{2}, where occurrence is a zero based occurrence of the tag book. |
||||||||||||
Find occurrence of |
Select this option if you want the installer to find a specific occurrence of a value of a tag or of a value of an attribute of a tag in the specified XML file. If you choose this option, the following additional options are listed:
Note • The Tag specified should be an atomic/leaf node tag in the XML file. |
Rules, Tags, and Rollback Tabs
For information on the other tabs on this customizer, see the following:
• | Rules—Use this tab to add rules to the selected action. For more information, see Assigning a Rule to an Action and Rules Reference. |
• | Tags—Use this tab to add build configuration tags to the selected action. For more information, see Assigning Tags to Project Elements. |
• | Rollback—Use this tab to specify rollback behavior for the selected action. For more information, see Configuring Installation Rollback Behavior. |
Performing Complex XML File Modifications
To perform complex modifications, you can use multiple Read/Modify XML File actions. For example, suppose you had the following XML file:
Sample XML File
In this XML file, if you wanted to replace the value of the id attribute with a value of 300 instead of 296 for those book elements that have an author subelement with a value of Jones, you would use the following two Read/Modify XML File actions:
• | Use the first Read/Modify XML File action with the Find occurrence of option selected to find a book element with an author subelement with a value of Jones. |
• | Use the second Read/Modify XML File action with the Replace value option selected to do the actual replace. |
Note • If there are multiple nodes in the XML file that satisfy a given set of criteria specified in the customizer of the Read/Modify XML File action, then only the first node is returned by the result value.
InstallAnywhere 2020 Help LibraryOctober 2019 |
Copyright Information | Flexera |