Create Delimited String from XML Nodes and Vice Versa in SOA 12c

A delimited string is a string representation of data separated by a delimiter(e.g. ","). A simple representation of the delimited string will look like.

Delimited String Examples
Sample-1-- Delimiter as "," 
Sample-2-- Delimiter as "|" 

If we want to represent the above set of delimited values in the form of an XML document under some root and parent tag. The representation will look like this.

XML Example
<root xmlns="">

Sometimes we may need to convert values coming in delimited string to an xml document or vice versa. Since delimited string is similar to csv format. We can create a nxsd schema and then perform translate i.e. native to xml or xml to native within our SOA application. But in the scenarios wherein we just want to convert one delimited string to xml or recurring xml nodes to one delimited string, there we can make use of oracle xpath extension functions:

  1. oraext:create-nodeset-from-delimited-string()
  2. oraext:create-delimited-string()


Note: Both functions can be used in XSLT or BPEL assign activity. The above two mentioned examples will be used for explaining these 2 functions.


This function is used to create XML node set from delimited string. Basic syntax of the function is as below.

oraext:create-nodeset-from-delimited-string ($qName, $delimitedString, $delimiter)

$qName: Qualified name of the node for each value to be created along with namespace. For e.g. '{}value'
$delimitedString: String containing values delimited by a delimiter. Examples as above.
$delimiter: String representation of delimiter. For e.g. ','
Sample XSLT code:
<xsl:template match="/">
        <xsl:copy-of select="oraext:create-nodeset-from-delimited-string('{}value','Value1,Value2,Value3' , ',' )"/>

Note: Excluding, the XSL header for a better view. Please make sure all namespaces are properly imported in the XSL header.
The above code snippet will give output as above example.


This function is used to convert nodes to delimited string. Below is the syntax of the function.
oraext:create-delimited-string ($nodeSetValue, $delimiter)
$nodeSetValue: repetitive nodes or combination of nodes for which delimited string needs to be created. For e.g.
$delimiter: String representation of delimiter. For e.g. ','
Sample code using the above sample
<!--',' as delimiter-->
<xsl:value-of select="oraext:create-delimited-string ($nodeSet/ns1:Values/ns1:value, ',')"/>
<!--'|' as delimiter-->
<xsl:value-of select="oraext:create-delimited-string ($nodeSet/ns1:Values/ns1:value, '|')"/>


Here $nodeSet contains the XML data as represented in above example. Above XSL snippets will yield results as shown in delimited string samples


  1. please sample code for XSLT

    1. Hi Abhishek, above code snippets are from XSLT. Can you please elaborate your problem statement?

  2. very helpful.. article helped in solving a critical requirement

  3. Thanks to the blogger for sharing such explanatory codes.
    Tableau Soap Connection


Post a Comment

Popular posts from this blog

DateTime formatting using xp20:format-dateTime ()

Handling XML response with or without namespace in Postman