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

RE: equivalence of two predicate tests

Subject: RE: equivalence of two predicate tests
From: "Conal Tuohy" <conalt@xxxxxxxxxxxxxxx>
Date: Tue, 27 May 2003 17:54:26 +1200
xsl predicate case
>   in a book i'm perusing at the moment, there's a discussion of
> simple predicates that's a bit confusing, so i just wanted to
> verify that the following two expressions were equivalent:
>
>   elt1[elt2/@attr="value"]
>
>   elt1[elt2[@attr="value"]]

I'll stick my neck out, Robert, and say "yes, they are equivalent"  :-)

Basically, if an elt1 has at least one @attr hanging off one of its elt2
children, that means it has at least one elt2 child with an @attr hanging
off it.

The predicate in the first case tests a set of the @attr attributes of elt2
children, while in the second case it tests a set of elt2 children having
@attr attributes. These sets are obviously different (unless empty) but they
will either both be empty, or they'll both contain at least one node. If a
nodeset is empty then it is converted to the boolean value "false", if not
empty it converts to "true".

There are people on the list with knowledge of the internal workings of some
XSLT processors who could comment on whether there are performance
implications, but I'd be surprised if there were any.


 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.