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

RE: Illegal attribute name

Subject: RE: Illegal attribute name
From: Jarno.Elovirta@xxxxxxxxx
Date: Thu, 3 Jan 2002 08:57:51 +0200
illegal attribute 608

> I use the template .
>   <xsl:template match="/test/T">
>     <xsl:element name="{@fldname}">
>       <xsl:apply-templates />
>            <xsl:value-of select="@reserve2"/>
>            </xsl:element>
>   </xsl:template>
> It gives illegal attribute name when I am using a number as 
> the 'fldname' value.
> If its an alphabet it works fine.what is the work around?

An element name must be a QName--see
<http://www.w3.org/TR/xslt#section-Creating-Elements-with-xsl:element>. If
you really want to generate looks-like-XML-but-isn't output, you could
generate the elements e.g. with name="x-{@fldname}" and then write your own
serializer to remove the "x-". 



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.