Incorrect XML escaping of semicolon

575 views
Skip to first unread message

googelybear

unread,
Mar 24, 2010, 6:34:32 AM3/24/10
to Google Web Toolkit
Hi,

It seems that GWT DOES escape the semicolon character but actually
this is a valid XML character and should not be escaped according to
http://www.w3.org/TR/REC-xml/#sec-references and
http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

Here's a snippet of how this error can be reproduced:
<code>
public static String escapeXml(String xml) {
Document document= XMLParser.createDocument();
Text textNode= document.createTextNode(xml);
return textNode.toString();
}
</code>

calling this method with ";" yields "&semi;". Semi is not defined as a
standard entity and thus produces errors in my backend.

Is this really a bug in the GWT XML parser or is my escaping method
wrong?

thanks for any feedback,

Dennis

Jeff Chimene

unread,
Mar 24, 2010, 11:09:13 AM3/24/10
to google-we...@googlegroups.com
Does this happen in all browsers, or just one? GWT uses the browser to perform the XML document/node manipulation.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


googelybear

unread,
Mar 31, 2010, 3:19:52 AM3/31/10
to Google Web Toolkit
This seems to be a long known bug in GWT (reported with high priority
in 2007....) that somehow never got fixed:
http://code.google.com/p/google-web-toolkit/issues/detail?id=1011

On Mar 24, 5:09 pm, Jeff Chimene <jchim...@gmail.com> wrote:
> Does this happen in all browsers, or just one? GWT uses the browser to
> perform the XML document/node manipulation.
>

> On Wed, Mar 24, 2010 at 3:34 AM, googelybear <googelyb...@gmail.com> wrote:
> > Hi,
>
> > It seems that GWT DOES escape the semicolon character but actually
> > this is a valid XML character and should not be escaped according to
> >http://www.w3.org/TR/REC-xml/#sec-referencesand
>

> >http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_re...


>
> > Here's a snippet of how this error can be reproduced:
> > <code>
> > public static String escapeXml(String xml) {
> >                Document document= XMLParser.createDocument();
> >                Text textNode= document.createTextNode(xml);
> >                return textNode.toString();
> >        }
> > </code>
>
> > calling this method with ";" yields "&semi;". Semi is not defined as a
> > standard entity and thus produces errors in my backend.
>
> > Is this really a bug in the GWT XML parser or is my escaping method
> > wrong?
>
> > thanks for any feedback,
>
> > Dennis
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-we...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsu...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages