Subj : Re: Embedding E4X support with SpiderMonkey To : netscape.public.mozilla.jseng From : Peter Wilson Date : Wed May 04 2005 05:28 pm Peter Wilson wrote: > I've used SpiderMonkey quite extensively in our Whitebeam server > (http://www.whitebeam.org) over the last 5 years, including integrating > it with my own XML/Xpath implementations in the server. > > I've just taken a look at the E4X spec, and realised it's implemented in > the latest CVS tree for SpiderMonkey. A lot of the functions mirror > standard Whitebeam features (whch didn't need any language enhancements, > so not sure they are required). > > I've just integrated the latest CVS tree into Whitebeam, and I seem to > have the core XML/XMLlist classes etc - but don't seem to be able to do > much with them. 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. > One thing missing I think is the required modified global object. > JS_InitStandardClasses doesn't seem to bind the new XML globals to my > global object (although it does bind things like parseInt etc), and I > can't for the life of me how to work out how to create an instance of > XML to use as the global object, or even if that's the right appproach. > > A pointer to some documentation would be great > > Hints/tips from anyone that has integrated E4X support into another > environment would be great > > Comments on the impact of (probably) having *another* XML engine in my > app-server also welcome. 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. > > Are there any hooks that I can use to integrate E4X with my own DOM-like > tree/Xpath implementation rather than having code parsed multiple times? > > Where do I start? > > One other point - unrelated - is their a target date for another > 'official' SpiderMonkey release? The last was back in June last year and > lots seems to have happened since then including a lot of good fixes. > > thanks in advance > Pete > > Pete -- Peter Wilson T: 01707 891840 M: 07796 656566 http://www.yellowhawk.co.uk .