[Home] [By Thread] [By Date] [Recent Entries]
Silvia Liberto wrote:
Hi all, here's an xslt1.0 version without extension functions: <xsl:template name="tokenize">
<xsl:param name="inputString"/>
<xsl:param name="separator" select="' '"/>
<xsl:param name="resultElement" select="'item'"/>
<xsl:variable
name="token"
select="substring-before($inputString, $separator)"
/>
<xsl:variable
name="nextToken"
select="substring-after($inputString, $separator)"
/>
<xsl:if test="$token">
<xsl:element name="{$resultElement}">
<xsl:value-of select="$token"/>
</xsl:element>
</xsl:if>
<xsl:if test="$nextToken">
<xsl:call-template name="tokenize">
<xsl:with-param
name="inputString"
select="$nextToken"/>
<xsl:with-param
name="separator"
select="$separator"/>
<xsl:with-param
name="resultElement"
select="$resultElement"/>
</xsl:call-template>
</xsl:if>
</xsl:template>and here's how you would use it to get what you want:
home://germany/45128 essen/lortzingstr. 11/ http://spunk.dnsalias.org phone://+49/201/491621 if you are a free (as in "free speech") software developer and you happen to be travelling near my home, drop me a line and come round for a free (as in "free beer") beer. :-D
|

Cart



