Last active
August 29, 2015 14:01
-
-
Save itod/3942c5a20abf37400356 to your computer and use it in GitHub Desktop.
NSXML XPath Bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Source.xml: | |
| <?xml version="1.0" encoding="utf-8" ?> | |
| <doc id="foo"/> | |
| Context Node: | |
| /doc/@* | |
| XPath: | |
| (ancestor-or-self::node())[1] | |
| Should return a node-set containing only the Root (Document) node. Apparently the parentheses should cause a document order sort because they signal the end of a PathExpr?. | |
| Saxon 6.5 and 9.5 get this right. NSXML returns a node-set containing the Context Node | |
| This Path should be equivalent, and it works in NSXML: | |
| (ancestor-or-self::node()/.)[1] | |
| Apparently the `/` is forcing the sort here. | |
| Note that this is different from : | |
| ancestor-or-self::node()[1] | |
| which will return a node-set containing the Context Node in all three processors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment