You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@agents.ICS.UCI.EDU on 2000/09/29 18:13:04 UTC

Re: ApplyXPath

(The documentation for the ApplyXPath example invites users to comment
on what functions might belong in the general XPath API. So here are my
comments.)

About my application:

I'm building a web crawler that is programmed by demonstration: the
user indicates what kinds of documents they'd like to collect, and the
system generalizes.

I'm using the JTidy HTML parser to convert HTML to XHTML, which I can
then parse into a DOM object. Then I look at the URLs a user has
selected from a given page and find structural similarities between
the XPaths to each anchor.

XPath requirements:

To do this, I need a couple of functions that are not present in the
current XPath API.

* Node -> XPath. It would be nice to have a canonical way to turn a
Node within a document into a XPath that leads back to that node. Of
course, there are many possible such paths. I've used the following
canonical form: "/parent[i]/parent[j]/parent[k]/node", but I can only
do this by creating a string and turning it into a path.

* Manipulation and comparison of XPath contents. Again, I can use the
String representation of a path, but then I have to write my own
parsing to find the chunks therein. The API should allow the step by
step construction and deconstruction of any given XPath.

* XPointer anyone? :)

-- 

robin
=:-{)
University of California, Irvine
Information and Computer Science Dept.

http://www.ics.uci.edu/~burke/

"The universe is made of stories, not of atoms" - Muriel Rukeyser