|
Subject: Re: [xsl] Selectively convert Attributes to child Elements From: Michael Ludwig <mlu@xxxxxxxxxxxxx> Date: Tue, 19 May 2009 10:51:07 +0200 |
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>
<?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>| 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 |