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

Re: style sheets

From: Ray Whitmer <ray@xmission.com>
Date: Thu, 23 Mar 2000 06:41:56 -0700
Message-ID: <38DA1F24.2B09E66F@xmission.com>
To: www-dom@w3.org
Dieter Köhler wrote:

> One addition to my last posting:  The current spec provides no
> information, how to add a DocumentType node created by the
> DOMImplementation to a Document node: The ownerDocument attribute of a
> new DocumentType has the value 'null'.  The methods for adding nodes
> to a node raise a "WRONG_DOCUMENT_ERR" if the node to be added "was
> created from a different document than the one that created this
> node".  So what should be done if one tries to add a node not created
> by any document at all?  Raise a "WRONG_DOCUMENT_ERR"?  --  The
> ownerDocument definition on p. 43 seems to presuppose, that the node
> should be added and change its ownerDocument attribute.  If that is
> right, then it would be good to mention it in the definitions of the
> methods it affects.

DOM level 2 provides only one way to use a DocumentType node once
you have created it:

Pass it to createDocument, where it says:
"When doctype is not null, its Node.ownerDocument attribute is set to the

document being created".

This is a minimal capability, which does not satisfy a number of cases,
especially not that of a parser, which probably does not discover the
doctype until after the document has been created, needs to be
able to add entities and notations as declarations are encountered, and
may need to preserve additional internal subset information.  Parsers
will
probably need to rely on proprietary interfaces until more is defined.

But it does allow a new document to be created with a specified doctype.

Ray Whitmer
ray@xmission.com
Received on Thursday, 23 March 2000 08:19:46 GMT

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