Hello there, first post here.

I've been trying to get my head around how to load an XML file from
file (ill deal later with actually uploading it to the server via the
interface) and here's what I've got from reading different posts on
the net, as well as the Simple XML Reader sample.

package com.moodlequizeditor.project.domparser;

import com.google.gwt.user.client.HTTPRequest;
import com.google.gwt.user.client.ResponseTextHandler;
import com.google.gwt.xml.client.Document;
import com.google.gwt.xml.client.XMLParser;


package com.moodlequizeditor.project.domparser;

import com.google.gwt.user.client.HTTPRequest;
import com.google.gwt.user.client.ResponseTextHandler;
import com.google.gwt.xml.client.Document;
import com.google.gwt.xml.client.XMLParser;



public class DomMain {

        public static void main() {

                HTTPRequest.asyncGet("myxml.xml", new ResponseTextHandler() {
                        public void onCompletion(String responseText) {
                                try {
                                        Document document = 
XMLParser.parse(responseText);
                                        new XMLLoad(document);

                                } catch (Exception e) {
                                        e.printStackTrace(System.err);
                                }

                        }
                });
        }
}


For some reason though, it's not reading 'myxml.xml' (I've put it
literally everywhere in my structure) but I get the following in
console:

[WARN] 404 - GET /com.moodlequizeditor.project.MoodleQuizEditor/
myxml.xml (127.0.0.1) 1441 bytes
   Request headers
      Host: 127.0.0.1:8888
      User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:
1.9.2.12) Gecko/20101026 Firefox/3.6.12
      Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
      Accept-Language: en-gb,en;q=0.5
      Accept-Encoding: gzip,deflate
      Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
      Keep-Alive: 115
      Connection: keep-alive
      Referer:
http://127.0.0.1:8888/com.moodlequizeditor.project.MoodleQuizEditor/hosted.html?com_moodlequizeditor_project_MoodleQuizEditor
      Content-Type: text/plain; charset=utf-8
   Response headers
      Content-Type: text/html; charset=iso-8859-1
      Content-Length: 1441

Thanks alot for the help.

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

Reply via email to