Skip to main content

Task XML - Delete Node​

The Delete Node Task deletes nodes, or one attribute of nodes, from an XML file. It deletes every node that the XPath expression selects.

Delete Node tab with the Credentials, File name, XPath expression and Attribute (optional) fields and the Namespaces list

The Main settings, Flow, On error, Conditions and TimeOut tabs are the same for every Task; see Job - Tasks.

warning

Every node that the XPath expression selects is deleted, not only the first one, together with its child nodes. Check what the expression selects in the XML Browser before you run the Task.

The Task saves its changes to the XML file itself and keeps no copy of the original file.

The Task reads and saves the file under the account of the VisualCron Server. A Credential selected in Credentials is not used.

Delete Node tab​

  • Credentials: A Credential can be selected, but the Task does not use it. The account of the VisualCron Server needs read and write access to the file
  • File name: The full path of the XML file
  • XPath expression: The XPath expression that selects the nodes to delete. To build the expression, click the button next to the field and select a node in the XML Browser; the button is available when File name is set
  • Attribute (optional): The name of an attribute. When set, only this attribute is removed from each selected node, and the nodes are kept. A selected node that does not have the attribute is left as it is
  • Namespaces: The namespace prefixes and URIs that the XPath expression can use. When the list is empty, the Client fills it with the namespaces declared in the file, with the prefix "x" for a default namespace. Use Add, Edit and Remove to change the list, and Reload to read the namespaces from the file again. At run time, only the namespaces in this list are used

Variables can be used in File name, XPath expression and Attribute (optional).

Output and errors​

  • When the XPath expression selects no node, the Task fails with the error "Node does not exist", and the file is not changed
  • The Task writes no output