[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
The Web Maestro schrieb:
Ciao Maestro,
in 1.0, use str:split(), allegro ma non troppo:
</xsl:stylesheet>
In 2.0, use tokenize() instead.
Michael Ludwig
Re: [xsl] Selectively convert Attributes to child Elements
Subject: Re: [xsl] Selectively convert Attributes to child Elements From: Michael Ludwig <mlu@xxxxxxxxxxxxx> Date: Tue, 19 May 2009 10:51:07 +0200 |
The Web Maestro schrieb:
Thank you! That was very helpful! One final addition: how do I get this new element:
<tags>news,breaking news</tags>
Converted to:
<tags> <tag>news</tag> <tag>breaking news</tag> </tags>
Ciao Maestro,
in 1.0, use str:split(), allegro ma non troppo:
<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:str="http://exslt.org/strings" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="tags"> <!-- To see how it works, uncomment the following line: <xsl:copy-of select="str:split( . , ',')"/> --> <xsl:copy> <xsl:for-each select="str:split( . , ',')"> <tag><xsl:value-of select="."/></tag> </xsl:for-each> </xsl:copy> </xsl:template>
<xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template>
</xsl:stylesheet>
In 2.0, use tokenize() instead.
Michael Ludwig
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Selectively convert Attri, The Web Maestro | Thread | Re: [xsl] Selectively convert Attri, The Web Maestro |
Re: [xsl] Grouping based on key res, Ganesh Babu N | Date | [xsl] question on xml-stylesheet pr, Hermann Stamm-Wilbra |
Month |