if you'll keep using the same context there's no point dragging it around
return the matching attribute - solve this path starting with the root and the given solving strategy
return the matching single element - solve this path starting with the root and the given solving strategy
return the matching list - solve this path starting with the root and the given solving strategy
return the list of matching attributes - solve this path starting with the root and the given solving strategy
a simple resolver for x path like stuff. note the limitation at the bottom
can resolve the following expressions
/a/b/c /a/b/@c /a/b[cond]/... /a/{assoc}b[cond]/...
/ a / * / c - ignore one level: explore all possibilities for just that level
One difference from classic xpath is that the root node can be specified, see "a" above
It also differs from a classic xpath by having the {assoc} option. Useful when navigating models that use assocations as well as composition (graphs). Using "/a/{assoc}b" means that it will use association {assoc} to find the b starting from a...
TODO the type system here is all gefuckt...need better understanding of variance in scala. See this http://www.nabble.com/X-String--is-not-a-subtype-of-X-AnyRef--td23428970.html
Example usage:
NOTE - this is stateless with respect to the parsed object tree - it only keeps the pre-compiled xpath expression so you should reuse them as much as possible
Note that this is a limited play-type thing. There are full XPATH implementations to browse stuff, like Apache's JXpath.
The main features of this implementation are: 1) small and embeddable 2) works for most every-day things and 3) extensiblity: you can easily plugin resolvers.