Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

samtregar (2699)

samtregar
  (email not shown publicly)
http://sam.tregar.com/

Journal of samtregar (2699)

Sunday March 30, 2003
05:06 PM

Class::XPath in the wind

[ #11320 ]
Class::XPath 1.0 has been released. It's basically a straight port of the OO-tree XPath matcher I was talking about a few weeks ago. So far I've used it with a simple test class, HTML::TreeBuilder and in the larger application where the code was originally developed.

The next step is to work on supporting more XPath syntax, which probably means writing a real parser. I'm particularly interested in adding attribute and content matching support which I think I can use in my application. I'm tempted to go with Parse::RecDescent but I know what that will do to performance. Maybe I should check out some of the simpler Yacc derivatives on CPAN...

I've also been thinking about the possiblity of supporting some kind of tree analysis to speed up query matching. Right now a query like '//foo' has to hit every node in the tree to see if it has any children named 'foo'. A simple cache mapping names to lists of nodes could speed that up quite a bit, at the expense of building the cache the first time. The problem is that the tree might change between building the cache and query time, and Class::XPath isn't in a very good place to notice. I suppose it's more of an interface issue than anything else.

-sam

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.