-
-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XPath queries in fragments do not properly find root nodes #572
Comments
Greetings! Thanks for asking this question. It's not clear to me whether a fragment should have processing instructions, but in any case, this appears to be related to #370 That is, if you search using "./processing-instruction()" you'll get a match. Hope that workaround helps you until we fix the real underlying issue with fragment searches. |
Ah, thanks, that helps. It does appear to the same core issue as #370. I've renamed the title to match. In summary:
The proper workaround for my case is:
If you feel that this is exactly the same as #370, close away! |
Also #1438. |
Summary (from conversation below):
foo
and./foo
match nodes at the top of the fragment, but/foo
does not.//foo
nor.//foo
match items at the top of the fragment.//foo
does not match any descendant items, but.//foo
does.Original Issue
The use case here is to remove all PIs from a fragment via:
The simple workaround (for PIs only at the root) is to find these nodes using Ruby:
The text was updated successfully, but these errors were encountered: