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

Re: value-of node test.

Subject: Re: value-of node test.
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 10 Jul 2006 16:22:38 -0400
Re:  value-of node test.
Steve,

At 03:12 PM 7/10/2006, you wrote:
I'm iterating thu an ordered list of services.

I have another list of the values of those services, but not in order.

As I move thru the ordered list, I'd like to get the value of the
unordered list which shares meets the service=@title test.

Is there a shorthand way to do this using value-of? I know I can
resort to xsl:when or xsl:if, if need be.

If the two lists of values are in the same document, you may simply need the current() function:


<xsl:value-of select="$services//Record[service = current()/@title ]/value" />

If one of the lists has to be provided by the stylesheet, see the "lookup tables" idiom as documented on the XSLT FAQ at:

http://www.dpawson.co.uk/xsl/sect2/N4995.html

Note that the table itself can be stored either in an external file, or in the stylesheet itself, accessed via a call to document('') (which returns the XML of the stylesheet parsed as a document).

Cheers,
Wendell

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.