[icedtea-web] RFC: PR766 javaws fails to parse an <argument> node that contains CDATA
Deepak Bhole
dbhole at redhat.com
Mon Sep 19 10:01:56 PDT 2011
* Omair Majid <omajid at redhat.com> [2011-09-16 18:03]:
> Hi,
>
> As explained in the bug report [1], icedtea-web ignores CDATA
> sections in JNLP files. I dug into the parser code a bit and found a
> few things.
>
> The code that sanitizes comments from jnlp files (sanitizeInput)
> actually removes CDATA sections along with comments. This is
> probably a bug.
>
Agreed. I don't know why CDATA is being thrown away either.
> (As an aside, I suspect that the reason this is done separately from
> the main parser is because the main parser is a rather strict XML
> parser and some of the locations where comments can appear in jnlp
> files are not accepted by the XML standard. See
> https://bugzilla.redhat.com/show_bug.cgi?id=449160 for examples of
> jnlp files that contain invalid comments)
>
> The NanoXML parser itself can parse and see CDATA sections. However,
> it is not quite perfect. It has trouble parsing when CDATA sections
> appear in certain places, or are surrounded by certain elements.
>
> I have attached 2 patches. The first patch adds a set of test cases,
> and the second makes the sanitizer skip special sections and just
> remove comments.
>
> Running the junit tests (including the ones in the patch) shows:
> Before fix: 5 Errors, 3 failures
> After fix: 7 Errors, 1 failure.
>
> The appearance of 2 new errors is a little surprising. But it turns
> out that the additional failures are being caused in JNLPMatcher
> tests - CDATA sections that were previously being sanitized away are
> now being fed to the parser which is failing to handle them. I will
> post a patch to address this later.
>
> Any thoughts or comments?
>
So the changes to the code make it handle comments now, correct? And the
changes to handle CDATA will be in another patch? Is there a risk that
passing of CDATA to the parser might start breaking existing apps (where
CDATA was being thrown, but the app continued to work)?
Also, please post changelog.
Thanks,
Deepak
More information about the distro-pkg-dev
mailing list