1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29:
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="currentPage"> <xsl:call-template name="get-item-from-array"> <xsl:with-param name="str" select="@path"/> <xsl:with-param name="item-no" select="3"/> <xsl:with-param name="seperator" select="','"/> </xsl:call-template> </xsl:template> <xsl:template name="get-item-from-array"> <xsl:param name="str"/> <xsl:param name="item-no"/> <xsl:param name="seperator"/> <xsl:choose> <xsl:when test="$item-no <= 1"> <xsl:value-of select="substring-before($str, $seperator)"/> </xsl:when> <xsl:otherwise> <xsl:call-template name="get-item-from-array"> <xsl:with-param name="str" select="substring-after($str, $seperator)"/> <xsl:with-param name="item-no" select="$item-no - 1"/> <xsl:with-param name="seperator" select="$seperator"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet>