You can insert xml into a regular html document if you properly
namespace every element, and then you can grab the text of the xml and
use GWT XmlParser to turn it into DOM; I believe it wraps the native
FF support anyway... Just be careful of IE, as it WILL parse
everything the same, but any Xml attributes that are also common Html
attributes like title, class or align will give you parse errors {IE's
getInnerHTML will not put quotes around titles or classes that don't
have whitespace in them...
<pre id="x">
<x:x xmlns:x="http://aiyx.info">
Some xml stuff...<x:y>More stuff...</x:y>
</x:x>
</pre>
And then,
Element xData = Document.get().getElementById("x");
if (xData!=null){
String xml = xData.getInnerHTML().replaceAll("<(/{0,1})(x|X):", "<
$1");//Get rid of the x: prefixes, they are for hosted mode
compatibility
if (!xUserAgent.xStandards()){//Only IE needs this step
xml=xml.replaceAll("(title|class|align|TITLE|CLASS|ALIGN)=([a-zA-
Z0-9\\.,</\\?:;'[\\{\\]\\}\\\\\\|\...@#\\$%\\^&*\\(\\)\\-\\+_=`~]*)(\\s|
>)", "$1=\"$2\"$3");
}
Document xNew = XMLParser.parse(xml);
//Do stuff with Xml Document...
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---