Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <xsl:template name="SplitStringAtSeparator">
  2. <xsl:param name="stringToSplit"/>
  3. <xsl:param name="separatorCharacter" />
  4. <xsl:choose>
  5. <xsl:when test="contains($stringToSplit, $separatorCharacter)">
  6. <xsl:value-of select="substring-before($stringToSplit, $separatorCharacter)"/>
  7. <xsl:call-template name="SplitStringAtSeparator">
  8. <xsl:with-param name="stringToSplit"
  9. select="substring-after($stringToSplit, $separatorCharacter)"/>
  10. </xsl:call-template>
  11. </xsl:when>
  12. <xsl:otherwise>
  13. <xsl:if test="$stringToSplit != ''">
  14. <xsl:value-of select="$stringToSplit"/>
  15. </xsl:if>
  16. </xsl:otherwise>
  17. </xsl:choose>
  18. </xsl:template>
  19.  
  20. hellothisisastringtosplit
  21.  
  22. node[1] = hello
  23. node[2] = this
  24. node[3] = is
  25. node[4] = a
  26. node[5] = string
  27. node[6] = to
  28. node[7] = split
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement