W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2001

Re: Ad Hoc Element Creation

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Mon, 5 Feb 2001 17:21:55 -0500
To: Jeff Winter <Jwinter@zefer.com>
Cc: "'www-dom@w3.org'" <www-dom@w3.org>
Message-ID: <OF6C91B438.5482E2A2-ON852569EA.007A0164@pok.ibm.com>

>  The current version of the Oracle parser allows an Element to be created
without reference to any document:

Not supported by the DOM, sorry. The closest approximation is indeed
Document.createElement() or Document.createElementNS(). If you already have
a Document object you can use it; if not, or if you want a new Document,
see the DOMImplementation.createDocument() method... which also deals with
creating a root element, so that's simpler than your sample refactoring.

The reason behind Nodes (not just Elements) belonging to a specific
Document: Different Documents may be in different DOM implementations (or
different subclasses of a single implementation), and may have internal
behaviors which aren't completely compatable with no des from other
Documents. The question of mixing nodes across implementations is being
studied (as the "embedded DOM" concept) but is far from being a solved
problem.

______________________________________
Joe Kesselman  / IBM Research
Received on Monday, 5 February 2001 17:22:06 GMT

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