Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


XML variables are represented by the XMLDocument object org.wso2.carbon.bpmn.core.types.datatypes.xml.api.XMLDocument which implements org.w3x.dom.Document. It also provides a set of user friendly function to query and update XML content with XPath. The following functions are available for the XML variable type with WSO2 BPS. 

Table of Contents

Object xPath(String xpathStr)
DescriptionThis function evaluates the XPath query and returns the relevant element.
xpathStrThe XPath expression that is to be evaluated.
  • A org.w3c.dom.NodeList is returned if there is more than one elements in the result.
  • A org.w3c.dom.Node object is returned if there is only one element in the result.


Node appendChild(String xPathToParent, Element element)

This function appends a child element to the target element.

xpathToParentThe XPath to the parent node.
elementThe element that is to be appended.

The node either gets appended or returns a newly added node if the object is an element.

Node insertBefore(String xPathToTargetNode, Element element)

This function inserts a new child node before the specified existing node.

xpathToTargetNodeThe XPath to the target node.
elementThe element that is to be inserted.

The node gets inserted.

String toString()

This function will serialize the XML object to a string.

Element createNewElement(String elementStr)

This function creates a new element.


This is a util method.