XML encoding for XPath expressions
16:04, 15 Mar 2001 UTC | Eric van der Vlist

Following a long thread initiated by Charles Reitzel about the need of a XPath API and the suggestion made by several posts to define a XML encoding that could be returned by SAX XPath parsers, Wayne Steele posted a proposal ( DTD and examples) for such an encoding under the title "XML-Encoded XPath: an alternate syntax for XPath expressions".

This proposal doesn't use XPath syntax, but rather provides a straight XML representation of the concepts described in the XPath 1.0 recommendation:

  • An XPath expression is broken into a sequence of location steps and represented as a multi-rooted set of location steps.
  • Each location step contains the three parts (axis, node test and one of more predicates).
  • The function calls are defined by their name and set of parameters.

Steele welcomes questions, comments and errata.

Related stories:

Re: XML encoding for XPath expressions (Eric van der Vlist - 10:05, 21 Mar 2001)

I don't see the purpose of this proposal as a replacement of the current XPath syntax for authoring XPath expressions, but rather as an alternative to developping a new API for the applications needing to parse XPath expressions.

In other words, this syntax doesn't need to be materialized in XML documents but could be useful to carry information between XPath expressions parsers and applications using a standard SAX or DOM API following this content model.

Another benefit of this "exercise" has been to reveal similarities between XPath (and therefore Schematron that is built on XPath rules) and other schema languages such as TREX that I hadn't forseen before, just because of the very different syntaxes they are using.

> Re: XML encoding for XPath expressions (goldgewicht - 14:44, 26 Mar 2001)
> Re: XML encoding for XPath expressions (goldgewicht - 14:49, 26 Mar 2001)

Re: XML encoding for XPath expressions (Oleg Tkachenko - 16:12, 17 Mar 2001)

I think it's rather ugly idea. XPath syntax is a very balanced brevity-clearness tradeoff while the proposed syntax kills both brevity and clearness.

Re: XML encoding for XPath expressions (Arved Sandstrom - 03:29, 17 Mar 2001)

Seems like a solution to a non-problem. Maybe I'm a bit jaundiced about the Grand XMLification that seems to be occurring.

XML is at its best when it adds information - the original intent. That is, structured data thrugh XML markup. Definite value-add.

Exactly what information is being added when you XMLify an XPath expression, or a UNIX regular expression, or a methematical expression? Well, none, actually. So why do it?

Ease of processing? Efficiency of processing? I don't buy that, either. If anything I think we're haeded in the wrong direction here, too.

Not to mention, original, concise, and clear syntaxes are being rendered unreadable through verbosity. Secondary point, but non-negligible.

xmlhack: developer news from the XML community

Front page | Search | Find XML jobs

Related categories