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

RE: Relative XPATH between 2 nodes

Subject: RE: Relative XPATH between 2 nodes
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 28 Jan 2005 15:31:51 -0000
xpath _in .net
> If the input is just the Xpaths then clearly one algorithm  
> is to delete
> "equivalent" steps from the start of each path,

Only if the paths select single nodes. If the paths are

a/b/c[@x=3]/d

and

a/b/c[@x=4]/d

then you can't return

../../c[@x=4]/d

unless you know there is only one b.

The problem is seriously under-specified.

Michael Kay
http://www.saxonica.com/


 and then to  enough
> ../ to the second for each of the remaing steps in the first so
> 
> /a/b[2]/c/d
> /a/b[2]/e/f
> 
> goes in the first stage to
> c/d
> e/f
> 
> and so finally returns a relative path of
> ../../e/f
> 
> 
> However given 
> id('x')
> id('y')
> 
> you'd just have to return
> id('y')
> 
> On the other hand, if you also input a particular document into teh
> algorithm and ask for a relative Xpath that gets from one to teh other
> _in that document_ you may well be able to return something else, eg
> *[1]
> if the structrure was
> <foo id="x"><bar id="y"/>....
> 
> 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
> ______________________________________________________________
> __________

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.