Versions Compared

Key

  • 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
maxLevel5
minLevel5

Object xPath(String xpathStr)
DescriptionThis function evaluates the XPath query and returns the relevant element.
xpathStrThe XPath expression that is to be evaluated.
Return
  • 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)
Description

This function appends a child element to the target element.

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

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

Node insertBefore(String xPathToTargetNode, Element element)
Description

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.
Return

The node gets inserted.

String toString()
Description

This function will serialize the XML object to a string.

Element createNewElement(String elementStr)
Description

This function creates a new element.

Note

This is a util method.