Subj : Re: Embedding E4X support with SpiderMonkey To : Peter Wilson From : Brendan Eich Date : Wed May 04 2005 10:49 am Peter Wilson wrote: > For example: > > new XML('') > > claims an XML syntax error, possibly down to the XML namespace being > > unsupported. > > Answered part of this myself : JS_SetOptions(..., JSOPTION_XML) which > seems to get the basic XML engine working. Yes, that's required for backward compatibility. JS handles the trick I perpetrated in 1995 to get inline scripts wedged into HTML without showing in older browsers than Netscape 2 (beta, at that time). > For further clarification - my existing DOM/Xpath without having to > rebuild another shadow of the tree. (Note - my XML parser etc is > written in C++ and integrated as a set of native classes that shadow > parts of that tree on demand). Having to serialise that back to text - > then have the SpiderMonkey engine re-parse it into a tree isn't going to > be efficient, especially in a server-side application. See https://bugzilla.mozilla.org/show_bug.cgi?id=270553. I have a patch I've been neglecting on account of higher priority work, that adds an API to Gecko's DOM. It implements the rest of ECMA-357 -- new XML(document), .domNode/.domNodeList, etc. You could use it for the same purpose with your DOM impl, but I'm sure it will need some revamping. How about I get the patch into that bug and get the DOM hookup working with Gecko, then you try that E4X/DOM API out with your DOM code? /be .