Implode
Concatenate Nodes
Description
Convert a nodeset into a string using a delimiter.
XSLT
View Raw
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template name="implode"> <xsl:param name="items" /> <xsl:param name="separator" select="', '" /> <xsl:for-each select="$items"> <xsl:if test="position() > 1"> <xsl:value-of select="$separator" /> </xsl:if> <xsl:value-of select="." /> </xsl:for-each> </xsl:template> </xsl:stylesheet>