xsl-list
[Top] [All Lists]

RE: [xsl] Selecting lots of nodes with lots of criteria

2010-09-02 11:37:09
At 2010-09-02 18:30 +0200, Fabien Tillier wrote:
Is this like an Index on a table ?

More like a lookup table of nodes. The match= specifies the node in one column (say "left column"), and the use= specifies the lookup value in another column (say "right column").

One then uses key() to return all nodes from the left column whose corresponding lookup value is the right column is the second argument of the function call.

There are drawings on this page that may help:

  http://www.CraneSoftwrights.com/resources/xslkeys/index.htm

I hope this helps.

. . . . . . . . Ken

-----Message d'origine-----
De : Martin Honnen [mailto:Martin(_dot_)Honnen(_at_)gmx(_dot_)de]
Envoyé : jeudi 2 septembre 2010 17:38
À : xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Objet : Re: [xsl] Selecting lots of nodes with lots of criteria

Fabien Tillier wrote:

> select="//Row[NUMERO = (1, 2, 3, 4, 5, 6, 7, 8)]"
> is working !!!! (and a lot more faster...)

If speed matters you could of course define a key
   <xsl:key name="k1" match="Row" use="NUMERO"/>
and then use
   select="key('k1', (1, 2, 3, 4, 5, 6, 7, 8))"


--
XSLT/XQuery training:   after http://XMLPrague.cz 2011-03-28/04-01
Vote for your XML training:   http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
G. Ken Holman                 mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--