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 ( http://ode.apache.org/xpath-extensions.html) which can be used to generate arrays from a string. The method accepts four input parameters as follows.
if $input is as follows,
the output will be as follows.
split-to-elements() method should be used under the namespace of "http://www.apache.org/ode/type/extension"
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
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.
Refer to Split.zip and the example usage of the function as given below:
This method accept three parameters as follows.
$tmpVar- input source varaible
','- delimiter string
'chunk'- the target XML element
Suppose initial value of
split-to-elements() the value of