i need to loop through all the nodes in the xml document and append the values with comma ( , ) finally after the last element i should not have commma (,)
can any body help me.
thanking you, Ramana kumar.
i need to loop through all the nodes in the xml document and append the values with comma ( , ) finally after the last element i should not have commma (,)
can any body help me.
thanking you, Ramana kumar.
In XSLT 2.0 (or greater) you can use
xsl:value-of
with a separator:In XSLT 2.0 (or greater) you can use the string-join function.
You can do something like this:
The
position()
function returns the index of the current element in thefor-each
context, andlast()
returns the index of the last element.The Conditional Processing with
xsl:if
section of the XSLT documentation provides more information about this example.