Skip to Content
0
Former Member
May 20, 2007 at 07:00 AM

XSLT Mapping

36 Views

Dear friends,

I am getting a comma separated string in one of the element of the incoming XML file which I need to map into separate elements in the output file. How to go about it?

E.g. <b>Input file element:</b>

<Input>One,Two,Three,Four,Five</Input>

<b>Output Required:</b>

<Output>

<First>One</First>

<Second>Two</Second>

<Third>Three</Third>

<Fourth>Four</Fourth?

<Fifth>Five</Fifth>

</Output>

Using <xsl:value-of select="//Input"/> I am getting output as:

<Output>

<First>One,Two,Three,Four,Five</First>

<Second>One,Two,Three,Four,Five</Second>

<Third>One,Two,Three,Four,Five</Third>

<Fourth>One,Two,Three,Four,Five</Fourth?

<Fifth>One,Two,Three,Four,Five</Fifth>

</Output>

How to solve this ???

Awaiting Experts reply !!!