On 09/29/2011 01:39 PM, Laura Bickle wrote:
> 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?

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.

> *
>     at 
> Unknown.java_lang_Throwable_fillInStackTrace__Ljava_lang_Throwable_2(Unknown
> Source)
>     at 
> Unknown.com_google_gwt_xml_client_DOMException_DOMException__SLjava_lang_String_2V(Unknown
> Source)
>     at 
> Unknown.com_google_gwt_xml_client_impl_DOMParseException_DOMParseException__Ljava_lang_String_2V(Unknown
> Source)
>     at 
> Unknown.com_google_gwt_xml_client_impl_XMLParserImplSafari_throwDOMParseException__Ljava_lang_String_2V(Unknown
> Source)
>     at 
> Unknown.com_google_gwt_xml_client_impl_XMLParserImplSafari_$parseImpl__Lcom_google_gwt_xml_client_impl_XMLParserImplSafari_2Ljava_lang_String_2Lcom_google_gwt_core_client_JavaScriptObject_2(Unknown
> Source)
>     at 
> Unknown.com_google_gwt_xml_client_impl_XMLParserImpl_$parse__Lcom_google_gwt_xml_client_impl_XMLParserImpl_2Ljava_lang_String_2Lcom_google_gwt_xml_client_Document_2(Unknown
> Source)
>     at 
> Unknown.com_atti_aas_griffin_dashboard_client_Config_$parseChart__Lcom_atti_aas_griffin_dashboard_client_Config_2Ljava_lang_String_2V(Unknown
> Source)
> 
> 
> On Thu, Sep 29, 2011 at 1:18 PM, Jeff Chimene <jchim...@gmail.com
> <mailto:jchim...@gmail.com>> wrote:
> 
>     On 09/29/2011 12:41 PM, Laura Bickle wrote:
>     > Hi Jeff,
>     >
>     > I tried using curl.  It showed my angle brackets as &gt; and &lt;
>     but I
>     > don't think that matters to my code because it looks right in the
>     print
>     > statements.
>     >
>     > I don't think my xml is actually malformed because, when I include the
>     > xml file directly in the archive, my gwt client parses it without
>     problem.
>     >
>     > Thank you for suggesting xmllint.  I hadn't heard of it before.  I'll
>     > try it and see if it provides any clues.
>     >
>     > Thanks again for your help
> 
>     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.
> 

-- 
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-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to