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

Re: Assembling variable names by XSL and getting them

Subject: Re: Assembling variable names by XSL and getting them evaluated
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 18 Jan 2006 13:10:40 GMT
names of the keys
> Is there a way to get Saxxon 8B 

ah, so you are using xslt2. It's best to say that up front, the current
version of xslt is 1.0 and you are likely to get a 1.0 answer unless you
specifically ask for 2.0.

>      <td>{$lightsource3}</td>

{} syntax is only used in attribute values, where you can't use an
element. To evaluate an XPath such as {$lightsource3} you'd use
value-of. However you can't construct an xpath on the fly and evaluate
it it (well you can using saxon's evaluate extension) any more than in C
or java or fortran etc, you can't take a string with a bit of language
syntax and evaluate it. You don't have the language parser available at
run time.

You don't want lots of variables just one
<xsl:variable name="key">
<k id="0">unknown</k>
<k id="1">Daylight</k>
.....


Then you just need to use <xsl:value-of
select="$key/k[@id=current()/@exif:Lightsource]"/>

To look up the numbers in your xml fragment.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.