W3C home > Mailing lists > Public > www-dom@w3.org > July to September 1998

Nodes outside of documents

From: Claude Zervas <claude@utlco.com>
Date: Tue, 11 Aug 1998 00:06:22 -0700
Message-Id: <3.0.3.32.19980811000622.00938880@mail.blarg.net>
To: www-dom@w3.org

DocumentFragment appears to be a placeholder for nodes or
node trees that can be in the process of being cut/pasted from
one document to another. During this phase it seems like the nodes
might not be attached to a particular document. This would be
very useful for creating templatized documents, for example,
where some commonly used document fragments are cached and
pasted into the document or rendered serially into an enclosing
document when converted to ascii in a web server.

However, the spec for Document clearly states that nodes may not
exist outside the context of a particular Document. This appears
to contradict the idea of DocumentFragments.

I apologize if I'm completely missing something here, but
any help clearing this up would be much appreciated!

I've built an HTML40 parser that builds up a DOM tree from
either a full document or valid document %block fragments.
It would be nice to not have to always have to create a
full Document object just for the fragments.
My template engine takes a top-level document and a hashtable
of named document fragments that are substituted into
the output stream whenever a SUBST tag is encountered.
This allows me to share document fragments with multiple
master template documents since the merging is done
at serialization time.

Also, just a comment on a possible future server-DOM, it
would be nice to be able to deprecate attributes like
Node.nextSibling, Node.previousSibling and Node.ownerDocument
that make the nodes completely encrusted into the collection
they reside in. This makes it very inefficient if some
of the nodes are remote objects and some are local.
And please bring iterators back!
Being able to mix and match nodes from different DOM
implementations would be very handy, especially for
distributed documents. As I understand it, the current
DOM forbids this.

Thanks,
- Claude Zervas
Received on Tuesday, 11 August 1998 02:57:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:45 GMT