-
-
Notifications
You must be signed in to change notification settings - Fork 897
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
DocumentFragment#xpath fails to find specific attribute for elements at the root of the fragment #213
Comments
Workaround is to use |
The plot thickens. Apparently it fails to find elements at the root of the fragment, but succeeds if they're nested:
Similarly, an xpath like |
I believe this is related to the fact that we just need to redo the partial implementation. I suggest that if you can, grab a prerelease version of nokogiri and use the Node#parse method. We're going to try backing the fragment code with Node#parse for the next release. |
I'm starting to think this is either a) expected behavior or b) a bug in libxml2. Apparently switching to the new document fragment stuff I was working on didn't fix this issue. Anyway, the reason I suspect it's either expected behavior or a bug in libxml2 is that if you adjust the XPath, you can find those elements:
Which will output (using nokogiri master):
I am researching more. |
Meanwhile I am using the wrapper: doc = DocumentFragement.parse("<div id='__wrapper__'>#{body}</div>")
#proccess
result = doc.xpath("#__wrapper__").to_s |
Folding this into #572, the underlying issue is the same. |
Same problem applies to
at_xpath
.The text was updated successfully, but these errors were encountered: