In a Javascript file in Google Apps Script (not Google Script but a Caja-ed Javascript), I want to parse a string to an XML document. Outside of GAS this works:
$.parseXML("<root><message>Hello World</message></root>");
But in a GS file:
<script type="text/javascript">
var xml = $.parseXML("<root><message>Hello World</message></root>");
alert(xml);
</script>
the parseXML claims my xml is invalid. I assume this is something weird with whatever pre-processing GAS does to my JavaScript (Caja?). Is there a solution? I've tried with Jquery 1.11 and 1.9.0
Unfortunately, Caja does not support XML DOM.
If anyone is interested in what it would take to contribute such support, the main additions to the DOM taming component which would be needed are:
Document
s which are not associated with a virtual frame (or in spec language, a browsing context). For an example of the difference, in an inert document you should be able to insert a <html:script>
element without Caja concluding the script should be actually executed.