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

Re: attribute test

Subject: Re: attribute test
From: Jon Gorman <jonathan.gorman@xxxxxxxxx>
Date: Thu, 15 Sep 2005 15:27:37 -0500
Re:  attribute test
I think there is some confusion here.

not(/Root/foo/@att!='hi')
will return true if the document has all the /Root/foo/@att have the value
hi.

So you should be getting results from all those documents that have
all those @att attributes with values of hi.  If you want to only
process if there is at least one @att that doesn't have the value hi
you should be able to do just

/Root/foo/@att!='hi'

(not() is negation.  When working with node sets I believe it returns
true if there is any node in the node set that satisifies the
condition.  I'd have to double check the standard for what happens
with comparing two nodesets, but that's neither here nor there.

I was kinda wondering how that solution was working but figured
perhaps my brain was scrambled today as well ;).

Jon Gorman

ps See the first note in 3.4 of the XPATH 1.0 spec for a similar
description of the not(foo != name) type test

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.