Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
Split email addresses by delimiter and print values. Additionally insert BR element after 3th element
<xsl:template name="SplitEmailAddresses" ddwrt:ghost="">
<xsl:param name="emailAddresses" select="."/>
<xsl:param name="separator" select="';'"/>
<xsl:param name="counterEmail" select="1"/>
<xsl:if test="($counterEmail mod 4) = 0">
<xsl:when test="not(contains($emailAddresses, $separator))">
<xsl:value-of select="$emailAddresses" disable-output-escaping="yes" />
<xsl:value-of select="substring-before($emailAddresses, $separator)" disable-output-escaping="yes"/>
<xsl:call-template name="SplitEmailAddresses">
<xsl:with-param name="emailAddresses" select="substring-after($emailAddresses, $separator)"/>
<xsl:with-param name="separator" select="';'"/>
<xsl:with-param name="counterEmail" select="$counterEmail+ 1"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.