Add Element

The Add Element action adds an Xml element to an existing xml document.  To use this action you provide a path to an existing Xml Document by selecting from a list of known folders on the client target and then providing a sub path and file name.

You then provide an XPath expression to identify the parent element that the new element will be added to.  If more than one element matches the Xpath expression, you can choose one of five actions:

      Add the element to all nodes (the default action)

      Add the element to only the first node found

      Add the element to only the last node found

      Don’t add any elements

      Abort the update

 

Once the parent node is found, you can choose to add the new element at the beginning (before siblings) or at the end (after siblings) of the parent document element.

A new element is added at this location using the element name provided.  If a value is provided, the text will be placed inside opening and closing tags.

If an element already exists that matches the element being added, you can choose take one of four actions:

      Insert the new element, ignoring any previous ones (The default action)

      Delete any existing elements, then insert the new one

      Do not insert the element

      Abort the update

This action requires a full path to an xml file, defined by setting a target client folder, any appropriate sub path information and a file name.  In addition to the full file path, the element name must be provided.  The element value is optional.

A list of Attributes can be defined, which will be added to the newly created element.

Prepare Stage

Verifies permissions to modify the xml file.

Execute Stage

Backs up the xml file then inserts the new xml element, performing the operation as defined by the action properties.

Cleanup Stage

Removes the backup file created during the execute stage.

Rollback Stage

Restores the xml file with the file backed up in the execute stage.