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

Re: Testing against node-set

Subject: Re: Testing against node-set
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 6 Feb 2003 14:55:27 +0000
against node
Hi Nadia,

> <xsl:for-each
> select="$secondRowSet[parentID!=$firstRowSet/@id]">

The problem is that you've used ...!=... when you want to use
not(...=...).

When you use a node set with != it tests whether *any* of the nodes in
that node set fulfil the condition that you're testing. So the above
gets those rows that (a) have a parentID and (b) have a parentID whose
value is not equal to one of the IDs from the first row set.

This doesn't select your row 3 because row 3 doesn't have a parentID.
It does select your row 4 because row 4 has a parentID of 1, and 1 !=
2, which is the id of one of the rows in the first row set.

If you instead use:

  $secondRowSet[not(parentID = $firstRowSet/@id)]

then it will select those rows that don't have a parentID (because
then there's no parentID to be equal to an ID from the first row set)
and not select those who have a parentID whose value is equal to *any*
of the IDs from the first row set.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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


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.