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

RE: Simple xpath software request

mike thanos
> I have been trying to find a related tool/function for some time (and
> may well have missed it in my search) - an x-path validation tool.
> Such a tool would be capable of validating a given x-path against a
> schema.

Nothing in a schema can make an XPath 1.0 expression invalid. What is
possible is that by examination of a schema you can statically determine
that a particular XPath expression will return an empty node-set. (In fact,
you can do this for some expressions even in the absence of a schema,
examples are "/..", "@comment()", "@x/@y", "item[0]".)

This kind of static analysis is being done by some of the XQuery prototype
implementations; check the XQuery home page http://www.w3.org/XML/Query for
a list of implementations. Similar techniques are also used in the Tamino
database engine: see http://www.tamino.com/

Michael Kay
Software AG
home: Michael.H.Kay@n...
work: Michael.Kay@s...

> Is anyone aware of such a tool?  It would be a great assistance to my
> non-'expert' x-path writers (and even the expert ones!)
> Mike
> At 11:47 AM -0500 28/2/02, Daniel Veillard wrote:
> >On Thu, Feb 28, 2002 at 12:58:41PM -0700, Kris Thompson wrote:
> >>  I must have missed it but I feel like my searching has
> been complete.  I
> >>  am looking for a way, using one of the more popular parsers idealy
> >>  Xerces, to if given a node in a document return the XPath string
> >>  representation of that node.  Something like the
> following would be nice
> >>
> >>  public static String getXPath(Document doc, Node node)
> >>
> >>      where node is the node that I want the XPath
> expression on and doc
> >>  is the document for which this node exist.
> >>
> >>  If this does not exist in any popular parsers than has
> anyone created
> >>  this piece of code for which I could have?
> >
> >   Available as:
> >      xmlChar * xmlGetNodePath(xmlNodePtr node);
> >
> >in libxml2 (http://xmlsoft.org/)
> >    http://xmlsoft.org/html/libxml-tree.html#XMLGETNODEPATH
> >
> >Note of course that there isn't "the" XPath string to select
> that node
> >there is an infinity of those. 2 implementation could return
> different
> >path and both be right.
> >
> >Daniel
> >
> >--
> >Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
> >veillard@r...  | libxml Gnome XML XSLT toolkit
>http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
>The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
>initiative of OASIS <http://www.oasis-open.org>
>The list archives are at http://lists.xml.org/archives/xml-dev/
>To subscribe or unsubscribe from this list use the subscription
>manager: <http://lists.xml.org/ob/adm.pl>


Mike Thanos
Lending Technology Services Pty Ltd

The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://lists.xml.org/ob/adm.pl>


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.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.