[HtmlUnit] [htmlunit:bugs] #2012 Javascript in CDATA block causes EvaluatorException: illegally formed XML syntax
RBRi via HtmlUnit-develop <[email protected]> Sun, 24 Feb 2019 12:16:08 -0000
| Newsgroups | gmane.comp.java.htmlunit.devel |
|---|---|
| Message-ID | </p/htmlunit/bugs/2012/1e68d05a36c21a8187f5678a38f58f55c71be0bf.bugs@htmlunit.p.sourceforge.net> |
Same problem with style declarations.
---
** [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 11:19 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 [email protected] 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.
_______________________________________________
HtmlUnit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop