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

Re: constructing the Node Sets

Subject: Re: constructing the Node Sets
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 30 Jan 2003 09:51:42 GMT
Re:  constructing the Node Sets
> It still seems passing strange to me that "preceding::c[1]" should give
> different results than "(preceding::c)[1],

ordering (and so [1]) are only defined in a step. but an Xpath
expression, including () expressions only return sets.
You may thave wanted (preceding::c) to return something in reverse doc
order, but what about
(preceding::c|following::c|id('ggg')|$x) here intuition is less helpful about any
natural order so the spec just specifies that the if you filter such an
expresion with a [] predicate then the current node list is produced by
sorting forwards document order. (Actually it cunningly hides this fact
by instead stating that the default axis is child:: but the _only_
effect of this default axis is to specifying the ordering)


This is all different (and less natural) in Xpath2 which is based on
sets rather than lists. Set union naturally does "the right thing" but
the natural operation on lists is concatenation which isn't usually
what's wanted, so to get the right behaviour Xpath2 drafts specify that
certain operations (ike / and |)  explictly sort and remove duplicates
to obtain a list in doc order. This works but is less natural to specify
as you have to specify this behaviour on each operation.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. 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
________________________________________________________________________

 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.