|
Rank: Newbie
Joined: 5/18/2016 Posts: 5 Location: Utah
|
How do I create a dynamic commas using XSLT function? I have a data set that may be one individual person, up to 15 people. What do I need to do in order to set it up so as to create a delimiter comma for each subsequent individual, and on the last individual the comma is not created.
|
|
Rank: Advanced Member
Joined: 2/27/2009 Posts: 565
|
You could either use the string-join() function, or wrap the comma in a condition testing the position of the current item in the sequence.
|
|
Rank: Newbie
Joined: 5/18/2016 Posts: 5 Location: Utah
|
Do you by chance have an example of this? Or a code snippet?
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
string-join is documented along with all other XPath functions here
https://www.w3.org/TR/xpath-functions-31/
in your case it would be something like string-join( person, ',' )
|
|
Rank: Newbie
Joined: 5/18/2016 Posts: 5 Location: Utah
|
Appreciate the help Vlad and K101. Thank you!
|
|
guest |