[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: modify the tag name of a given List Node
Subject: Re: modify the tag name of a given List Node
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Fri, 23 Apr 2010 17:40:01 +0200
|
Red Light wrote:
hi,
i got a node like this:
<keywordDetails>
<key><label>PRP</label></key>
<key><label>PRPI</label></key>
<key><label>vf</label></key>
<key><label>vfvfv</label></key>
<key><label>dfvdv</label></key>
<key><label>svddvvd</label></key>
</keywordDetails>
and i need to tranform it to output like :
<keywordDetails>
<key1><label>PRP</label></key1>
<key2><label>PRPI</label></key2>
<key3><label>vf</label></key3>
<key4><label>vfvfv</label></key4>
<key5><label>dfvdv</label></key5>
<key6><label>svddvvd</label></key6>
</keywordDetails>
anybody have an idea about how to do that
<xsl:template match="keywordDetails">
<xsl:copy>
<xsl:apply-templates select="key"/>
</xsl:copy>
</xsl:template>
<xsl:template match="key">
<xsl:element name="key{position()}">
<xsl:copy-of select="node()"/>
</xsl:element>
</xsl:template>
--
Martin Honnen
http://msmvps.com/blogs/martin_honnen/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
RSS 2.0 |
|
Atom 0.3 |
|
|