How to convert a JavaScript XML Document to a com.google.gwt.xml.client.Document

16 views
Skip to first unread message

hsoulard

unread,
Nov 27, 2007, 7:30:03 AM11/27/07
to Google Web Toolkit
Hi,

I have a JavaScript code that builds a XML document. I would like to
use this document in a Java class by converting it to a
com.google.gwt.xml.client.Document. How should I proceed?

Thanks for any help.

Hervé Soulard.

L Frohman

unread,
Nov 27, 2007, 3:16:43 PM11/27/07
to Google-We...@googlegroups.com
I think you are stuck doing it the hard way, node by node. Use the
GWT XMLParser createDocument(), then traverse the javascript
document, for each Node use the GWT Document's createElement(),
and use Node appendChild(), Element setAttribute(), etc.

You could also convert the javascript xml document to a string and have the
GWT XMLParser parse it.

Reply all
Reply to author
Forward
0 new messages