[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

distance between elements and hierarchical order

David Carlisle davidc at nag.co.uk
Fri Dec 9 13:07:02 PST 2005


  distance between elements and hierarchical order
> I build a sequences with their QName 

why sequences of names rather than the elements themselves?
especially if you then compare with eq as that means you can't tell one
element from another. It only works in the example you gave as all your
element names were distinct. If your doc had nested elements with teh
same name, and you wanted to compare
doc("test.xml")/A/A[2]/A/A[3] and doc("test.xml")/A/A[5]/A[2]/A[1] then
your sequences will each be a sequence of "A" with no indication of
which element it is naming, and every item in the sequnce will compare
true with eq against every other item, so  
where $x-name eq $y-names[$x-pos]
isn't going to test anything as it will always be true().

The code I posted should work for this example as it doesn't require the
element names to be distinct.

David


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


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-2007 All Rights Reserved.