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

Re: Re: Re: Re: order of UNIONs

Subject: Re: Re: Re: Re: order of UNIONs
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 15 Nov 2001 08:26:54 -0800 (PST)
 Re: Re: Re: Re: order of UNIONs
> > I think one of the major problem of the XPath 2.0 Data Model is that
> > they do not distinguish between lists and sets, trying somehow to
> > say that a node-set is a kind of list (the actual term used there
> > was "sequence", if I remember well). The consequences are bad
> > problems, because some operations on lists cannot be performed 1:1
> > on sets, and vice versa -- not every list is a set, an operation
> > performed on a sequence, that is a nodeset, may not yield a nodeset,
> > a nodeset operation performed on a sequence that is a nodeset, may
> > behave quite differently from the same operation, performed on a
> > sequence (e.g. eliminating/preserving duplicates on a union/append
> > operation).
> 
> In a way I'm quite looking forward to having node sequences rather
> than node sets, since it's a frequent trap that beginners fall into,
> and it will one less thing for David to get mathematical about ;)

You lose one distinct datatype and put two that are quite different into one -- I
wouldn't call that a step forward.

> From what I can see in the XQuery/XPath WDs, it doesn't look as though
> there will be a concept of 'sets' in XPath 2.0. My guess is that a
> location path will return a sequence in document order. The xf:union()
> function is defined as returning a sequence of unique nodes in
> document order. It's a distinct operation from the , operator for
> appending one sequence to another. So:
> 
>   {$item1, $item2} | {$item1} => {$item1, $item2}
>   {$item1, $item2} , {$item1} => {$item1, $item2, $item1}
> 
> I haven't noticed anything where, when manipulating node sequences in
> the same way as you currently construct node sets, things work
> differently from the way they would if you were actually working with
> node sets, though I might be missing something and there's nothing in
> either WD about how you will actually select nodes using location
> paths in XPath 2.0.

Yes, if the programmer exercises ***discipline*** to always use the proper subset of
operations on the proper (sub-) datatype.

What about a template that expects a parameter of type "node-set sequence" but gets
called with just "sequence"? It doesn't seem straightforward and natural to detect
such cases and take the necessary corrective action. This is what you get when
mixing two different datatypes together.


Cheers,

Dimitre Novatchev.

__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.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.