2

I have an XML object which comes as the response from a web service. I obtain the XML data using

Document xmlDoc = XMLParser.parse( response );

What is the easier and better way to render the xmlDoc in my DialogBox widget?

EDIT

Am having an XML object. I want to render the data inside a panel and show it on the GUI. Hope this helps.

To put in a better way,

Is it possible to directly add XML document to a panel in GWT, or we should parse the same and build the panel ourselves?

Thanks.

1
  • Can you elaborate more? what do you want? Do you want to layout xml as node structure in DialogBox? Commented Jun 6, 2013 at 6:00

1 Answer 1

4

you have to parse the web service response

Document messageDom = XMLParser.parse( response );

Then, you can get the node value by

String nodeValue = "";
final NodeList nlist = messageDom.getElementsByTagName( tagName );
if (nlist == null || nlist.getLength() <= 0) 
    nodeValue = "";
else 
    nodeValue = nlist.item(0).getFirstChild().getNodeValue();

from here, you can now set panel component value to nodeValue

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.