Nexial Automation

Test Automation Platform for everyone!

X

xml » replaceIn(xml,xpath,content,var)

Description

This command search against specified xml via xpath, and replace content against all matching instances’ content. The final (modified) XML is then stored in a data variable specified as var. Note that this command replaces content of the matching XML nodes, not the matched nodes.
If xpath refers to attribute of xml, it will replace value of all matching attributes with specified content.

Parameters

  • xml - the XML document or file
  • xpath - the XPATH to specify the target area of impact
  • content - the content to replace, may be text content, attribute value or well formed XML snippet
  • var - the variable name to store the beautified content.

Example

Script:
script

Output:

See Also