Subj : Re: Problems/bugs? in e4j
To : netscape.public.mozilla.jseng
From : Martin Honnen
Date : Sun Sep 25 2005 03:35 pm
conor325 wrote:
> 1) XML object not reentrant? You can't work on two XML trees in the
> same function?
>
> This won't work:
>
> var top = ;
> top.oneDown = ;
> var top2 = new XML(""); // replicates serialized XML loaded
> from a file
> // now back to first top - it fails. Context lost? XML not reentrant?
> top.oneDown.stuff = stuff;
I have tried that code with the latest Firefox 1.5 beta nightly
(Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b5)
Gecko/20050924 Firefox/1.4) and I don't get any errors and the code
works as expected in my view.
There was a bug with E4X literals Brendan has mentioned in an older
thread so you might have run into that bug. Try a newer build, I think
the problem is fixed and the above should work now.
> 2) Can't assign the DOCTTYPE processing instruction?
The E4X object model does not know DOCTYPE declarations at all, an XML
object represents an element or an attribute or a comment or a
processing instruction or a text node. And a DOCTYPE declaration is not
a processing instruction.
So you can't have a literal/an initializer with a DOCTYPE declaration.
--
Martin Honnen
http://JavaScript.FAQTs.com/
.