|
[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 orderDavid Carlisle davidc at nag.co.ukFri Dec 9 13:07:02 PST 2005
> 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






