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

Re: What is an XPath API?

  • From: Matt Sergeant <matt@s...>
  • To: "Martin v. Loewis" <martin@l...>
  • Date: Wed, 07 Mar 2001 00:05:03 +0000 (GMT)

what is an xpath
On Tue, 6 Mar 2001, Martin v. Loewis wrote:

> The recent discussion on an XPath API gives a good occasion to report
> on the XPath API we've been developing for the Python XML libraries.
> 
> When integrating 4XSLT, we found the need for different parsers for
> XPath expressions. One is based on flex and bison; it is quite fast,
> but not thread-safe, and does not support Unicode input. The other one
> is written in pure Python using the sre regular expression engine.
> 
> To use the same XPath implementation (i.e. set of classes representing
> XML expressions, and evaluation routines), we've defined an API which
> the parser can use to create a tree representation of an XPath
> expression. This API involves interfaces to the expression nodes, and
> factory operations to create instances of expression nodes. This API
> is available at
> 
> http://www.informatik.hu-berlin.de/~loewis/xml/xpath.idl

One simplification that I use in XML::XPath is to merge Absolute and
Relative location path's, and rather than map directly to the grammar, map
to a more human recognition of what they are - a list of steps. What I
mean by this is that while the grammar says:

RelativeLocationPath: Step
		| RelativeLocationPath '/' Step

To a human reader, they see: /foo/bar/child as a list of things separated
by '/', not in recursive terms like the grammar.

I think this also makes the implementation easier and faster, but YMMV.

-- 
<Matt/>

    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
     \\//
     //\\
    //  \\


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
 

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.