Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <xsl:template name="SplitStringAtSeparator">
- <xsl:param name="stringToSplit"/>
- <xsl:param name="separatorCharacter" />
- <xsl:choose>
- <xsl:when test="contains($stringToSplit, $separatorCharacter)">
- <xsl:value-of select="substring-before($stringToSplit, $separatorCharacter)"/>
- <xsl:call-template name="SplitStringAtSeparator">
- <xsl:with-param name="stringToSplit"
- select="substring-after($stringToSplit, $separatorCharacter)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$stringToSplit != ''">
- <xsl:value-of select="$stringToSplit"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- hellothisisastringtosplit
- node[1] = hello
- node[2] = this
- node[3] = is
- node[4] = a
- node[5] = string
- node[6] = to
- node[7] = split
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement