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

RE: Re: xslt query a data

Subject: RE: Re: xslt query a data
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Tue, 22 Apr 2003 20:02:02 +0100
equavalent in xml
> > 
> > for example I have a table or equavalent XML have
> > below information
> > 1, a
> > 2, b
> > 3, c
> > 4, d
> > 
> > In my stylesheet, I only have a, b, c, d value
> > but I need to use 1, 2, 3, 4 as a substitution
> > 
> 
Set up a document called lookup.xml as follows:

<table>
<entry code="1" val="a"/>
<entry code="2" val="b"/>
...
</table>

Then you can do:

document('lookup.xml')/table/entry[@val=$val]/@code

For convenience, you can put the table inside the stylesheet - in
standard XSLT 1.0 you can reference the stylesheet as document(''), but
more efficiently you can put the lookup table in a variable and
reference it with the extension function xx:node-set().

For further efficiency with large lookup tables, learn about xsl:key and
the key function.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • RE: Re: xslt query a data
    • cknell - Tue, 22 Apr 2003 13:03:01 -0400 (EDT)
      • Paul - Tue, 22 Apr 2003 13:36:40 -0400 (EDT)
      • Michael Kay - Tue, 22 Apr 2003 14:57:34 -0400 (EDT) <=
      • <Possible follow-ups>
      • cknell - Tue, 22 Apr 2003 14:38:46 -0400 (EDT)

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.