Travis Webb
Travis Webb

Reputation: 15018

Convert GWT xml.client.Document to XML string

I have a com.google.gwt.xml.client.Document object I used XMLParser.parse(...) to create. I would like to serialize it back to the XML string from which it was derived. What is the easiest way to do this? I don't see a straightforward way from reading the Javadocs on this and related classes.

Any help is appreciated, thanks.

-tjw

Upvotes: 3

Views: 2071

Answers (2)

Chris Lercher
Chris Lercher

Reputation: 37778

Easiest way:

document.toString();

Upvotes: 5

asgs
asgs

Reputation: 3984

If you're fine with going for an external lib, XStream is the best bet. Have a look at this two-minute tutorial

Upvotes: -1

Related Questions