Oracle SOA Suite Online Training

Interested in learning Oracle SOA Suite 12c?
Learn from the author of this blog!
A complete and comprehensive course on the #1 platform on SOA - Oracle SOA Suite

Click here to find the complete course details
Click here to check the first session on Oracle SOA Suite 12c


Tokenize a CSV and do a for-each in XSLT 1.0

There are cases where you'll have a csv and need to do a for-each on each of the tokens.
For ex, a CSV stored in a DVM has to be iterated and needs to be assigned to a target for each of the token

Here is how you can tokenize

<xsl:stylesheet version="1.0"
<xsl:template match="/">
<!-- Here I'm hardcoding the value, but this could be from any xml where you'll give an expression instead of a value, or from a DVM -->
<xsl:variable name='csv' select="'a,b,c'"/>
<xsl:for-each select="tokenize($csv,',')">
<xsl:value-of select="."/>

And the result is

<?xml version="1.0" encoding="UTF-8"?>

No comments:

Post a Comment