3

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

1

2 Answers 2

5

Easiest way:

document.toString();
Sign up to request clarification or add additional context in comments.

Comments

-1

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

1 Comment

I know about XStream, it is built for serializing arbitrary Java objects. This is a Document object, which represents XML one-to-one already, like the DOM. Also, XStream must be compatible with GWT's deferred binding to convert the Java code to Javascript. This is not the solution I'm looking for.

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.