tags:

views:

29

answers:

1

HI,

I have a string value returned from a servlet code. I want to parse the string into XML and show the XML in a GWT window.

I tried with google.xml.client.* package but was not successful. Can you please tell how to accomplish this task.

A: 

You probably want to check out GWT's XMLParser class, and in general the entire com.google.gwt.xml.client package.

Here is a fairly good example of its use.

Jason Hall
Hi.. i tried out with the example mentioned in the above link. But in my case, all the tags are being placed on the same line. Can you suggest me how to place tags on a different line maintaining the heirarchy.
newGWT
Can you clarify what you're trying to do? Your server returns some XML on one line, and you want to display it with newlines and indentations? If so, what you're talking about is called "pretty printing". I don't have any code to do it, but knowing the term should help you on your google-quest.
Jason Hall
Thanks a lot Jason...i was struggling for it for a day...
newGWT