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

RE: First element with given attribute values

Subject: RE: First element with given attribute values
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Sun, 11 Apr 2004 19:36:07 +0200
xsl first element
> -----Original Message-----
> From: Nicolas Mailhot [mailto:Nicolas.Mailhot@xxxxxxxxxxx]
>
> Thanks everyone for the info!
>
> I already had something with keys, but it was much less elegant since
> the test was not node in the match part but via an xsl:if the template.
>
> I this particular case the trimming is done on a variable (via
> exsl:node-set()) so keys do not work (the keyed tree must exist at the
> start of the processing, right ?).
>

Strictly speaking: the key definition is not linked to a certain tree before
it is called upon by key(). When key()  is used, the context node determines
which document the key() function operates on. If you change that by use of,
for example:
<xsl:for-each select="document('x')/*">

When key() is used inside the for-each, it will return nodes from
document('x').

In theory, this opens up the possibility of redirecting the content of your
node-set variable to a separate (temporary) XML file, and use key() in
combination with document() as described above to have it return the nodes
from you temporary tree.
The use of a temp-file to store the node-set variable in itself can be
considered to be suboptimal, I guess, but just to show that the possiblity
does exist...


Cheers,

Andreas

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.