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

Re: weird key-nodeset behavior

Subject: Re: [xsl] weird key-nodeset behavior
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 25 Nov 2004 16:03:38 GMT
Re:  weird key-nodeset behavior
> 3) the key definition does not work for the nodeset.

They key indexes all elements in the document: it has nothing to so with
any variable.

If you have 
<xsl:key name="key" match="dovizler" use="key">

and <xsl:variable name="mydovizler" select="dovizler[2]"/>

Then given 
<x>
<dovizler><key>a</key></dovizler>
<dovizler><key>a</key></dovizler>
</x>

Your expression of

select="$mydovizler[generate-id(.) =  generate-id(key('dkey',key)[1])]"

will work, but it will select all the elements in $mydovizler that are
the first elements in the document for their key value.

In this case there is only one element in mydovizler, and it has key
value 'a' but it isn't the first such element in the document so
the empty node set is selected.

the key definition works, it just isn't doing what you want.

Unfortunately it isn't clear what you do want as you only showed the non
working definition, not a description of what you are trying to do.

> should i give the input file?(xml and xsl)

complete runnable files are good, but best to take the time to cut them
down as above to five or six lines, so that just the problem is
highlighted not your entire input source.

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.