From: RBRi <rb...@us...> - 2019-02-24 11:19:32
|
As always it took some time to work on this. From my point of view this has to be handle by the parser. Have done a fix because the neko parser can already handle this. Please have a look at twitter (https://twitter.com/HtmlUnit). Will inform about a new snapshot if available. --- ** [bugs:#2012] Javascript in CDATA block causes EvaluatorException: illegally formed XML syntax** **Status:** open **Group:** 2.33 **Created:** Mon Feb 11, 2019 01:16 AM UTC by Ron HD **Last Updated:** Sun Feb 24, 2019 09:54 AM UTC **Owner:** nobody Javascript code wrapped in an XML CDATA block within a <script> tag on a web page causes HtmlUnit to throw the following exception: > net.sourceforge.htmlunit.corejs.javascript.EvaluatorException: illegally formed XML syntax This can be replicated with the following Java code: `(new net.sourceforge.htmlunit.corejs.javascript.Parser()).parse("<![CDATA[obj1.obj2.func1();]]>", "", 1);` This occurs on web pages that use Oracle ADF (I believe this is the same problem reported in Bug #1991). These web pages are accepted by Firefox and other major browsers. Tracing through the code, I can see that the TokenStream.getNextXMLToken() method successfully scans over the CDATA block, but then rather than processing the contents of the block, it just does: `parser.addError("msg.XML.bad.form");` I'm not sure why it does this, or the right way to fix it. With a little guidance, I may be able to provide a fix. Or if someone can give me one, it would be great. Otherwise, I'm being forced to use Selenium with Firefox, which is introducing other problems. --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |