You encode the XML as regular text within an HTML page. Then you decode it to get the original document back.
optionally, you can use base64, which while probably expanding the code, is a much simpler approach & much more difficult to get wrong. There's plenty of free implementations of base64 in JS & non-ie browsers actually supply a native base64 encode/decode function (window.btoa, window.atob). I'd only recommend using base64 if your XML is small or if you can return a gzipped document (not sure if FormPanel allows it, but I would be surprised if it doesn't). Another approach (faster & less overhead) would be to just put your JSON response in the HTML page. then you can just do an eval on the result & it'll be much faster for everyone involved (server & client). On Sat, Apr 25, 2009 at 9:04 AM, Charlie <[email protected]> wrote: > > I found this thread searching: > > http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/674c7863d88700c9/510196f74a09b4b7?lnk=gst&q=getResults#510196f74a09b4b7 > > can anyone explain to me the trick that is being offered in the before > last message? > it will be really helpful > thanks you > > On Apr 25, 3:50 pm, Charlie <[email protected]> wrote: > > Hey Everyone > > > > I'm stuck with the following issue: > > I'm sending a form to my php file and I want to get response as an xml > > but the only way possible is in HTML, how can I turn this HTML to XML. > > > > I'm talking about: > > onSubmitComplete(SubmitCompleteEvent event) > > > > event.getResults() > > > > The results from the PHP file returns as an HTML instead of an XML > > like I wanted. > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
