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

Re: using variable as a value for "use-attribute-sets

Subject: Re: using variable as a value for "use-attribute-sets"
From: Jörg Heinicke <Joerg.Heinicke@xxxxxx>
Date: Sat, 5 Jan 2002 13:27:22 +0100 (MET)
use attribute sets
> Hi,
> I have a variable declared called "setname"
> I want to use it as the value of  "use-attribute-sets".
> I tried this,
> <xsl:variable name="setname" select="name()"/>
> <xsl:element name="block">
> <xsl:attribute name="use-attribute-sets"><xsl:value-of
> select="$setname"></xsl:attribute>
> </xsl:element>
> but it results in <block use-attribute-sets="node-name"/>
> can anyone tell me someway?
> -tony

Of course it can't work, because you only add an attribute to <block> named
'use-attribute-sets' - nothing more. But 'use-attribute-sets' must be an
attribute of <xsl:element> no in the output, but in the input.

So it has to be

<xsl:element name="block" use-attribute-sets="$setname"/>


<block xsl:use-attribute-sets="$setname"/>.

But there is only one problem: use-attribute-sets doesn't seem to be allowed
with variables. MSXML throws an error, Xalan ignores it. The changing to
use-attribute-sets="{$setname}" doesn't help either.

So I can only give you a hint, why your code doesn't work, but not how to
solve it.



GMX - Die Kommunikationsplattform im Internet.

 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.