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

Re: Select attribute using a variable

Subject: Re: Select attribute using a variable
From: strawks <strawks@xxxxxxxx>
Date: Wed, 23 Jan 2008 11:18:37 +0100
Re:  Select attribute using a variable
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Abel Braaksma wrote:
> You cannot do it like this, as XSLTProc is saying: it is a syntax error
> (after the double colon should be a node name (QName) not a variable
> name). Instead, if you want to check the name of an attribute and then
> select that attribute, try this:
> 
> select="/document/styles/style[@name=$style_name]/@*[name() = $property]"

This is working like a charm, thanks for the quick answer!

> If there are more <style> nodes with an attribute "name" with the value
> of $style_name, this may return more than one attribute, depending on
> the XSLT version. If you need to do something for each <style>, use
> templates instead of an absolute XPath.

Each "name" attribute of <style> is unique so this is not a problem.

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

iD8DBQFHlxR9+2TXLlA5m78RAvhYAJ9kGh8uC2/njfuHom4Gcs58t5wONACcDpxA
OT/p5LR+kUVyPp4dvHSwFQM=
=lwFO
-----END PGP SIGNATURE-----

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.