This documentation is for WSO2 Enterprise Integrator version 6.5.0 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

All docs This doc
Skip to end of metadata
Go to start of metadata


This sample explains the usage of split-to-elements() function.

Introducing split-to-elements() Function

This function is a XPath extension supported by the Apache ODE engine ( which can be used to generate arrays from a string. The method accepts four input parameters as follows.

split-to-elements(stringToSplit, separator, targetElement, targetNamespace)

For example,


if $input is as follows,


the output will be as follows.



split-to-elements() method should be used under the namespace of ""

Deploying the Sample

WSO2 BPS provides a sample, which can be deployed and executed to understand the function. Follow the instructions below to deploy and trigger the process.

1. Log in into BPS server management console and select "Processes -> Add" under the "Main" menu.

2. Upload the <EI_HOME>/samples/business-process/bpel/ directory. 

3. In the "Deployed Processes" window, click the "Process ID" to access its "Process Information" window.

4. Under the "WSDL Details" widget, trigger the process using the "TryIt" link to create an instance of it.

Example Usage

Refer to and the example usage of the function as given below: 

      <from>ode:split-to-elements($tmpVar, ',', 'chunk')</from>

This method accept three parameters as follows.

  • $tmpVar - input source varaible
  • ',' - delimiter string
  • 'chunk' - the target XML element

Suppose initial value of tmpVar is


After executing split-to-elements() the value of myVar is

  • No labels