IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Dynamic Commas using XSLT Options · View
Amech
Posted: Wednesday, May 18, 2016 9:57:46 PM
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.

K101
Posted: Thursday, May 19, 2016 10:58:57 AM
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.
Amech
Posted: Thursday, May 19, 2016 3:46:07 PM
Rank: Newbie

Joined: 5/18/2016
Posts: 5
Location: Utah
Do you by chance have an example of this? Or a code snippet?
vlad
Posted: Thursday, May 19, 2016 3:52:50 PM
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, ',' )
Amech
Posted: Thursday, May 19, 2016 3:55:53 PM
Rank: Newbie

Joined: 5/18/2016
Posts: 5
Location: Utah
Appreciate the help Vlad and K101. Thank you!
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.