[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
> 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"/> or <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. Regards, Joerg -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|