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

Re: xsl:element name value with Attribute Value Templa

Subject: Re: xsl:element name value with Attribute Value Template at run-time
From: Joseph Kesselman <keshlam@xxxxxxxxxx>
Date: Wed, 29 Oct 2003 08:53:59 -0500
xsl element name variable



      <xsl:variable name="elementName" value="foo"/>
      <xsl:element name="{$elementName}">Will this work?</xsl:element>

      The Xalan processor complains that the attribute name is not valid
      because the $elementName variable is blank.

There is no "value" attribute for xsl:variable; check the spec.

There is a "select" attribute, but it is intepreted as an XPath expression,
so select="foo" would be setting the variable to a copy of the child
attribute called foo. However, you could have written an expression that
returns a string value:
      <xsl:variable name="elementName" select="'foo'"/>

But it's probably clearest to write
      <xsl:variable name="elementName"/>foo</xsl:variable>

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk


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


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.