|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XSL : how to turn <name> into <data elem="name">
<xsl:template match="*">
<xsl:choose>
<xsl:if test="name() = 'name'">
<data elem="name"><xsl:value-of select="."/></data>
</xsl:if>
<xsl:otherwise>
<xsl:copy>
<xsl:for-each select="@*">
<xsl:attribute
name="{name()}"><xsl:value-of select="."/></xsl:attribute>
</xsl:for-each>
<xsl:apply-templates/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
There is probably are more elegant way of doing it, but this should work,
and its too late to think about it harder *grin*
Ben
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








