On Fri, Jan 4, 2013 at 4:40 PM, Robin Green <
gre...@gmail.com> wrote:
> Thanks for improving the documentation in response to my feedback.
More than welcome.
> However, I still don't understand what the difference is between \@ and *@.
There isn't a difference any more. At one stage \ always opened up
children, but that led to special casing text nodes to being different
than a simple predicate.
Honestly I'm still not super thrilled with that part of the dsl (\+
for example is a pet hate), but its driven by the same E1/E2 problem.
>
> Another question, while I'm at it: What's the difference between the types
> XPath and XmlPath?
An XmlPath is any individual "node" in an XmlTree, basically a type
alias for the zipper.
XPath[PT]s are the representation of XPath over XmlPaths. The type
parameter is to allow using Vectors or indeed ImmutableArrays for the
results, but during tests List was the most peformant default type.
Given the performance gains for ImmutableArrays its something I'll
revisit.
The "over" bit is that for each step/axe the number of possible
matches can increase.
> I think I've worked out that XPath[PT] is more general
> and any library methods I create in my own libraries should take XPath[PT]s
> as arguments insead of XmlPaths - is that right?
>
That depends largely on what you want to do, if you are adding steps
to an XPath then XPath[PT] is what you should use. If you are just
using a particular part of a tree then XmlPath should be used, as its
only a single node.
You can always convert from XPath to an Iterable of XmlPath, but if
performing additional filtering you are better off keeping XPath as it
won't attempt to perform document ordering/filtering. It document
ordering / uniqueness isn't important there are speed gains to be had
from using "raw" for large sets to convert from XPath to
Iterable[XmlPath].
That could sound terribly vague I realise :< but I hope it helps.