[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: help on attribute name

Subject: RE: help on attribute name
From: "Aron Bock" <aronbock@xxxxxxxxxxx>
Date: Thu, 26 May 2005 00:00:12 +0000
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


this is what I wish to generate <?xml version="1.0" encoding="UTF-8"?> <fmcpfixxml fixversion="4.2"> <ft T35="D"/> <ft T11="6462"/> <ft T1="75265"/> <!-- lot more tuples like the above --> </fmcpfixxml>


<snip/>



This ugly and code bloat. I would like to have generated this as follows

<xsl:call-template name="taggen" >
<xsl:with-param name="id" select='T35' />
<xsl:with-param name="value" select='D' />
</xsl:call-template>


_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.