Hi mives29,
   I just solve the problem. It's quite direct and easy.

1. upload your xml file to any webserver, e.g. http://a.b.c/test.xml

2. use RequestBuilder to get it. your url.

3. String xmlStr = response.getText();

4. use XMlParser to parse the xmlStr. that's it. Sample snippet code
here:

    String url = "test.xml";
    RequestBuilder requestBuilder = new
RequestBuilder(RequestBuilder.GET,url);
    try {
           requestBuilder.sendRequest(null, new RequestCallback() {
           public void onError(Request request, Throwable exception) {
           }
           public void onResponseReceived(Request request, Response
response){
                String xmlStr=response.getText();
                //Parse it then.
           }
          }
          );
        } catch (RequestException ex) {
            GWT.log(ex.getMessage(), ex);
        }


Hope that helps
Sammi




On Nov 4, 7:24 pm, mives29 <[EMAIL PROTECTED]> wrote:
> Hi. I'm a newbie in GWT, and I've been tasked to create a utility
> class to parse xml files that the contents would be used in layouting
> the widgets in its container panel (along with other UI
> configurations).
>
> I've accomplished this by using a service, which uses Java's DOM style
> of parsing. This service returns an array list of serializable objects
> that I created (a POJO that stores the configurations). Then I use the
> POJOs inside that array list to set various stuff in the UI (xpos,
> ypos, etc) for different widgets.
>
> Then I've found out that GWT has the xml api, that I can use to parse
> my XML. However, XMLParser .parse() only accepts the string
> representation of the actual XML file. I thought that I could do the
> same thing I did with my service implementation (using
> documentbuilder.parse(path-to-xmlfile).
>
> Now I'm thinking of creating a service that would return a string
> representation of the XML file, then send it to my GWT class and let
> that class handle the parsing. Is this possible? or is this even
> acceptable?
>
> Ive been seeing stuff on the net using HttpRequest(or RequestBuilder?)
> to get XML from a script, but I dont know how to do that(the example
> was on php.)
>
> Any idea how can I implement this properly? Thanks
>
> mives29
--~--~---------~--~----~------------~-------~--~----~
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