We need to:
fn:
and string:
should not be mentioned explicitly. Saxon complains about an undeclared namespace, but the functions are in the default namespace. Removing the namespace prefixes fixes it. We could declare them explicitly though, which would likely work"false"
and "true"
(and single quote variants) fixes that one. Since they're keywords in the languages we analyse they can never occur in identifiers or other unexpected places.pmd-java:
namespace to calls to our custom functions.getParent
, and a DocumentNode
represents the root node which is wrong: every ast node, even the root, should be mapped to an ElementNode
, the document node is a virtual node that exists outside of the DOM for saxon.So migration cost is very low and a bunch of regex search and replace is probably enough to migrate any rule automatically. That could be done by the ruleset migration tool.
Consequently I don't see a need to issue a warning to users that still use 1.0. Especially so since we're going to make changes to the grammar for 7.0.0, so that telling them now to update to XPath 2.0, then telling them on 7.0.0 that anyway their updated rules most probably don't work anymore and need to be rewritten could be seen as a dick move.
The most inconvenienced users will be clients of the programmatic API of XPathRule, but that's not the only API which will be broken by 7.0.0 anyway. Deprecated annotations should be enough to warn them in advance.
Upgrading to Saxon HE also would provide much value, including support for XPath 3.1, and a super clean API to implement custom functions, and a cleaner API to implement external DOM wrappers. It drops support for XPath 1.0 compatibility mode, which is not a big loss, as the incompatibilities it prevented are corner cases and are realistically very rare in XPath rules.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4