--
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.
Hi AThinerCoin,
I agree with you : "I'm pretty sure it's not a GWT issue"...
1) if you want to serve XML from your servlet, why do you need to parse it ????? Simply serve it. That's all
2) did you set correct content type from your sevlet ? -> response.setContentType("text/xml");
3) did you close your stream with the close() method of the OutPutStream ?
4) your GWT client receive a raw XML stream. What do you do with it ?
xmllint doesn't complain, and neither does Emacs' nXML mode.
So, the problem is the way the data are sent to the client from the server.
Someone else asked, maybe I missed the answer: what is the document's
MIME type?
Also, did you try another browser? For example, I noticed that IE had
problems with one of my documents when FF did not.
--
http://en.wikipedia.org/wiki/XML_and_MIME
> My previous errors are from firefox. Per your suggestion, I tried using
> safari and chrome instead and they each gave me this error. The first
> line is the result of requesting the xml file. The second line comes
> from trying to parse it.
>
(document snipped)
> (-:-) 2011-09-29 13:32:28,838 [FATAL] Uncaught Exception:
> *com.google.gwt.xml.client.impl.DOMParseException: Failed to parse:
> error on line 1 at column 1: Document is empty
Well, that's a clue ;-
I tried the following:
final String s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><stuff> ..";
final Document doc = XMLParser.parse(s);
It had no problems.
The only differences:
1) I escaped the quote characters;
2) I removed the line breaks (^J) in your file to convert it to a string.
I'd investigate the line breaks, and possibly some garbage at the end of
the file that gets sent to the host.
Also, depending on your server, you might be sending a byte order mark
to the client and not realizing it.
> *
Hi Jeff,
I set the content type like so: response.setContentType("text/xml");
I think MIME is a superset of content type. I don't explicitly set any other MIME things. How do I look up the MIME type of a file?
My previous errors are from firefox. Per your suggestion, I tried using safari and chrome instead and they each gave me this error. The first line is the result of requesting the xml file. The second line comes from trying to parse it.
(-:-) 2011-09-29 13:32:28,825 [DEBUG] result:<?xml version="1.0" encoding="UTF-8"?><stuff>
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/1h74ivOd75AJ.