in reply to Traversing arbitrarily deep and baggy structures

There's already a query language that's well suited for searching XML: XPath. I use XML::LibXML for XML parsing, and it supports XPaths via findnodes and the like.

Replies are listed 'Best First'.
Re^2: Traversing arbitrarily deep and baggy structures
by anonymized user 468275 (Curate) on Feb 16, 2011 at 21:37 UTC
    Although this has plenty of bells and whistles, in my opinion it doesn't add enough crucial stuff to justify the slow performance. Larry Wall's XML::Parser already creates a perfectly good tree. The chosen task is to traverse that tree.

    One world, one people

      Slow? XML::Parser is a turtle in comparison! XML::LibXML is 20x faster than XML::Parser via XML::Simple. (XML::Parser alone doesn't create a tree.)

      Either way, there is a generic XPath module that can be adapted to any tree structure.