xsl-list
[Top] [All Lists]

[xsl] Select attribute using a variable

2008-01-23 03:00:11
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I have a variable named property and I want to select an attribute using
this variable.

Basically :
<xsl:value-of
select="/document/styles/style[(_at_)name=$style_name]/attribute::$property"/>

xsltproc says the following error :
XPath error : Invalid expression
/document/styles/style[(_at_)name=$style_name]/attribute::$property
                                                     ^
compilation error: file sample1.xsl line 114 element value-of
xsl:value-of : could not compile select expression
'/document/styles/style[(_at_)name=$style_name]/attribute::$property'

If I replace $property by a fixed name, it works fine.

Is it possible to use a variable in this case?

Any help would be appreciated.

regards,
strawks
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHlxAE+2TXLlA5m78RAvxJAKCNYCa4o9LPWUEeG4UzevMTlZvCKACgo8bc
eTqwbwVyHRLlMWbATindozw=
=o3hf
-----END PGP SIGNATURE-----

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>