Skip to main content

XML bindings

<name> is defined by the <nodeType> in <xmlRef> by xpath "<expression>"

Captures content from a referenced XML value using the given XPath expression and associates it with the given name. The value is resolved every time the name is referenced.

Where

  • <name> is the name of the name to associate the captured value to
  • <nodeType> is one of:

    • text to capture the text node
    • node to capture a single node
    • nodeset to capture multiple nodes
  • <xmlRef> is the name of the binding containing the XML source

    • Can be the name of any binding that contains or resolves to XML text, including a web element in which case the text in the element will be dynamically retrieved and used.
  • <expression> is the XPath selector expression

Optionally accepts the @Eager, @Lazy or @Masked annotations.

  • @Eager immediately evaluates the <expression> and binds the result to <name>
  • @Lazy evaluates the <expression> and binds the result to <name> when it is first referenced
  • In the absence of either of the above annotations, <expression> is evaluated every time <name> is referenced
  • @Masked masks the captured value to prevent it from being logged as clear text

Example

  Given the xml is "<result><status>passed</status></result>"
And status is defined by the text in the xml by xpath "//result/status"
Then the status should be "passed"