
Data::DPath::Parser - Parses the DPath subset used by Data::DPath

use Data::DPath::Parser; my $result = Data::DPath::Parser->parse( $xpath ); $result -> evaluate( $root, $context ); $sub = $result -> compile; $sub -> ( $root, $context );

Some notes on the parsing and evaluation:
TODO: change to return sets of references into the data tree
The result expressions alway return true or false. For DPath expressions that would normally return a node-set, the result is true if the current SAX event would build a node that would be in the node set. No floating point or string return objects are supported (this may change).
The DPath context node is the document root.
Not sure what to do about the context position, but the context size is of necessity undefined.

DPath is based on XPath, but has some subtle (or not-so-subtle) differences.
DPath makes use of the following axis:
Eventually (with Perl 6), we will be able to support arbitrary attributes tied to data objects. But until then, only the following attributes are supported:
Example: //*[@can="print" and @can="read"]
This will find all the nodes that have print and read methods.
Example: /foo[@defined]
Returns the object foo in the root of the context if it is defined.
Example: //*[@isa="Apache::Upload"]
This will find all the nodes in the context that are Apache::Upload objects.
This forces the identifier to be a child of a node. A child may be a hash key or an array index, depending on the parent node type. It will not be a method.
This forces the identifier to be a method of an object.