Re: How can I put a DocumentFragment in a Document?

Claude Zervas wrote:
> 
> What I don't understand is why the concept of "owning document" in the first place, if the WG meant "owning implementation" why not say so?  It would have been much more straightforward to eliminate the owning-document constraint and instead just state that nodes must be from the same _implementation_ and hoist the node factory methods out of Document and put them in DOMImplementation.  WRONG_DOCUMENT_ERROR would be WRONG_IMPLEMENTATION_ERROR instead, or just simply let the progammer be responsible for maintaining integrity.

You're missing the fact that one implementation may support more than
one type of document and use different classes of objects depending on
the type of document being used. This is actually true with Xerces,
where the XML DOM, HTML DOM, and WML DOM all use different classes of
objects, even though there is a single implementation.

> 
> >
> >>encourages bloated implementations (Xerces 1.2 is 1.5 megs!)
> >
> >Uhm... There's a lot more to Xerces than the DOM, remember.
> 
> Yes, I was being facetious. I apologize, especially since I use Xerces quite a bit! But it is way too big for smaller client-side applications.

The error has been to put everything into the same jar. With Xerces2
we'd like to have a set of smaller jars, and the design of the parser
will allow more flexibility within the parser itself. The validator
could be left out completely for instance.

> For one, I would really like to see iterators for node traversal. I was sad to see them argued out of the level one spec and could never figure out why they didn't come back in L2.
>
> Also, an event/listener API for document/node modification notification. This is useful in MVC patterns, even on a server app. As one example, say you have a distributed cache of serialized documents (or fragments) and some controller servlets that modify some authoritative document model, any listener caches would receive notifications of the changes and refresh accordingly.

I don't understand. Both of these are addressed in DOM Level 2, as part
of Traversal, and Mutation Events.
-- 
Arnaud  Le Hors - IBM Cupertino, XML Technology Group

Received on Tuesday, 21 November 2000 13:14:33 UTC