Data templates and transformations > Data transformation process reference > Custom XPath functions for data transformation > tdt:split()

tdt:split()
This function is similar to the str:split function defined in EXSLT. It splits a string and returns a node set of token elements. Each node set contains one token from the string.
Signature
<node-set> tdt:split(<node-set>, <string>)
<node-set>
<string>
Pattern string. The strings in <node-set> are split at any occurrence of this pattern.
Example
Data source
<data/>
Expected result
<data>
<split>Hello World</split>
<split>Good Bye</split>
</data>
Data template
<data>
<split>?</split>
</data>
Data transformation
<tdt:rule path="/data/split">
<tdt:value key=".">tdt:split( 'Hello World, Good Bye', ', ' )
</tdt:value>
<tdt:value key="text()">text()</tdt:value>
</tdt:rule>
OpenText StreamServe 5.6.2 Updated: 2018-01-26