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

At 09:32 AM 11/20/2000 , Joseph Kesselman wrote:
>... Remember that nodes belong to
>specific Documents, and may only be appended to that Document. If the
>DocumentFragment was created as part of one Document, you can _not_
>directly append its contents to another Document...

This is a very unfortunate design constraint that makes caching document fragments in a templating environment fairly inefficient. It usually requires a lot of needless node cloning in most DOM implementations.

I think this is just one of the many problems with the DOM that came from its browser/scripting heritage (such as Node.previous/nextSibling()) that warrants a better specification for efficient server-side use. The current spec also encourages bloated implementations (Xerces 1.2 is 1.5 megs!), which make them difficult to use in slim client apps or applets.
I recall that there where a number of people on the early DOM 1.0 lists that where in favor of creating a parallel spec for server-side or thin-client applications. If anybody would like to participate please let me know and perhaps we could start an "Alternate DOM" working group. JDOM has been doing something similar, but it is Java-centric.

Regards,
Claude Zervas

Received on Monday, 20 November 2000 22:14:19 UTC