Thank you for this class - it does exactly what I'm looking for - but unfortunately it fails to match some very simple XPath patterns, in particular anything that matches more than a single element. If I test the same patterns in other XPath environments, they work as expected. I note that the docs say that this class matches "simple" XPaths, but doesn't expand on what the limitations are. Here's an example:
Only the first of these callbacks triggers - /gmdata/header/goldmine_version matches a single element and works as expected. The second pattern never matches. Similar patterns like /gmdata/header/gmdbdef do not match either, yet they do in every other XPath env I've tried them in.
Is this a bug? Or a limitation of using XPath with this class?
Thank you for this class - it does exactly what I'm looking for - but unfortunately it fails to match some very simple XPath patterns, in particular anything that matches more than a single element. If I test the same patterns in other XPath environments, they work as expected. I note that the docs say that this class matches "simple" XPaths, but doesn't expand on what the limitations are. Here's an example:
Here is an XML file (saved as
data.xml
):Here is my script:
Only the first of these callbacks triggers -
/gmdata/header/goldmine_version
matches a single element and works as expected. The second pattern never matches. Similar patterns like/gmdata/header/gmdbdef
do not match either, yet they do in every other XPath env I've tried them in.Is this a bug? Or a limitation of using XPath with this class?