Skip to content
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

failing test (on jruby): css search problem involving whitespace and … #1320

Closed

Conversation

jkraemer
Copy link
Contributor

…node removal

The problem seems to occur only when due to removal of a node surrounded by whitespace two consecutive text nodes are left behind. In that case a css search for the remaining element ends up in a DTM exception:

Java::JavaLang::RuntimeException: Could not resolve the node to a handle
   org.apache.xml.dtm.ref.DTMManagerDefault.getDTMHandleFromNode(DTMManagerDefault.java:576)
    org.apache.xpath.XPathContext.getDTMHandleFromNode(XPathContext.java:184)       
    org.apache.xpath.XPath.execute(XPath.java:303) 
    nokogiri.XmlXpathContext.tryGetNodeSet(XmlXpathContext.java:198)
...

Since it might have been related I already tried replacing all uses of internal com.sun API with the official Xalan API, adding the 2.7.2 Xalan jars as per #1212, but it didn't help with this problem (and still caused the same errors mentioned there).

@marutosi
Copy link
Contributor

marutosi commented Sep 1, 2015

What is status? flavorjones/loofah#88 (comment) says this is Rails 4.2 with JRuby.

@marutosi
Copy link
Contributor

As I wrote at flavorjones/loofah#94 (comment), I cannot understand loofah and nokogiri support policy.

@flavorjones
Copy link
Member

Looking at this now.

@flavorjones
Copy link
Member

@kares If you are looking for important JRuby work, this issue is currently blocking Loofah and Rails on JRuby.

I've pushed the branch 1320_jkraemer_jruby-css-search-crash with the above failing test.

@kares
Copy link
Contributor

kares commented Feb 11, 2017

seems like a xalan bug to me - not sure about the 'best' work-around (since Xalan is no longer maintained).
might take me quite some time to get right - no promises that a fix will land (although do believe its fixable)

kares added a commit to kares/nokogiri that referenced this pull request Feb 12, 2017
`RuntimeException: Could not resolve the node to a handle`
kares added a commit to kares/nokogiri that referenced this pull request Feb 12, 2017
resolves sparklemotion#1319 (test borrowed from @jkraemer)

adjusted test for sparklemotion#1320  to be a little more complex
@kares kares mentioned this pull request Feb 12, 2017
jvshahid added a commit that referenced this pull request Sep 5, 2018
Looks like we replaced DOM2DTM with DOM2DTMExt when we fixed
#1320 but forgot to replace it in
the DOM2DTM manager

fixes #1749
flavorjones pushed a commit that referenced this pull request Dec 1, 2018
Looks like we replaced DOM2DTM with DOM2DTMExt when we fixed
#1320 but forgot to replace it in
the DOM2DTM manager

fixes #1749
flavorjones pushed a commit that referenced this pull request Dec 1, 2018
Looks like we replaced DOM2DTM with DOM2DTMExt when we fixed
#1320 but forgot to replace it in
the DOM2DTM manager

fixes #1749
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants