|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: help on attribute name
Raman, your approach should work. For example, this XML:
<data> <eftee id="T21" val="T-ventuno"/> <eftee id="T67" val="T-sessantasette"/> <eftee id="T1" val="T-uno"/> </data> Transformed with this XSL (xalan): <?xml version="1.0" encoding="iso8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/">
<data>
<xsl:apply-templates/>
</data>
</xsl:template><xsl:template match="eftee"> <ft> <xsl:attribute name="{@id}"><xsl:value-of select="@val"/></xsl:attribute> </ft> </xsl:template> </xsl:stylesheet> Produces: <?xml version="1.0" encoding="UTF-8"?> <data> <ft T21="T-ventuno"/> <ft T67="T-sessantasette"/> <ft T1="T-uno"/> </data> Check the quotes: for example, in the snippet below select='D' should have been select="'D'", et cetera. As you know select="D" (select the child D) is not the same as select="'D'" (select the literal character D) Regards, --A
<snip/>
_________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
|
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








