Subject: Select attribute using a variable
From: strawks <strawks@xxxxxxxx>
Date: Wed, 23 Jan 2008 10:59:32 +0100
|
-----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[@name=$style_name]/attribute::$property"/>
xsltproc says the following error :
XPath error : Invalid expression
/document/styles/style[@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[@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-----
|