I have a following scenario. I have a TEAM-MEMBERS node which has name in the format last name, first name
<TEAM-MEMBER><LONG-NAME>Last Name, First Name</LONG-NAME></TEAM-MEMBER>
I want to transform this to
<CONTACT><FIRSTNAME>First Name</FIRSTNAME><LASTNAME>Last Name</LASTNAME></CONTACT>
Basically i want to split the <LONG-NAME> node’s value by ,
How can I achieve this using XSLT 1.0
This XSLT will be consumed by BizTalk Server hence i am looking for some XSLT 1.0 solutions only
Thanks
Karthik
Here is a complete XSLT 1.0 solution that uses a general “split” template that splits a string into multiple substrings, provided a delimiter to designate the boundary between substrings:
When this transformation is applied on the provided XML document:
the wanted, correct result is produced:
II. Solution using FXSL
This transformation uses the
str-split-to-wordstemplate from FXSL:when applied to this XML document (made quite more complex):
the wanted, correct result is produced:
Do Note:
The
str-split-to-wordstemplate accepts multiple delimiters. Thus in this transformation the delimiters used are:',','('and')'