In my XSLT, I have used tokens to split substrings on a single delimiter (,) however how do I place a unique text to mark each substring? Thank you.
Example, XML document:
<list>1,4,7,9</list>
Desired output:
<w>1</w>
<x>4</x>
<y>7</y>
<z>9</z>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This XSLT 1.0 solution works for your example.
It recursively splits your input at a delimiter character and assigns individual parts to elements named according to a list you also supply as a parameter.
When either individual input parts or element names run out (whatever happens first), recursion stops.
This template produces, with your input of
<list>1,4,7,9</list>:Note that the sample output is lacking a document element and therefore is not a valid XML document.