W3C home > Mailing lists > Public > www-dom@w3.org > April to June 1999

Re: Q: DocType location (Level 1 Core)

From: Arnaud Le Hors <lehors@w3.org>
Date: Fri, 21 May 1999 16:28:13 +0200
Message-ID: <37456D7D.25A5D3BF@w3.org>
To: Sadao YASHIRO <sada@flab.fujitsu.co.jp>
CC: www-dom@w3.org
Sadao YASHIRO wrote:
> I am now reading "W3C DOM REC-LEVEL-1-CORE" document.
> Then, I have one question about the location of "DocumentType" object.
> Could someone show me how "Document" object must hold
> the "DocumentType" object?
> In the current DOM spec, we can see two different explanations.

One of the difficulties of reading the DOM spec comes from the fact that
the term "attribute" is used for two different things. There are the IDL
attributes you can find on interfaces and the XML/HTML element
attributes. We wish we could avoid this confusing situation but we
couldn't. We didn't define any of these, we simply had to live with both
of them...

> At first, at the DocumentType section, that was written
> as follows:
> :Each Document has a doctype attribute whose value is either null or
> : a DocumentType object.

This refers to an IDL attribute that gives direct access to the
DocumentType that is related to the Document.

> But, at the "1.1.1. The DOM Structure Model", It tells:
> :The node types, and which node types they may have as children,
> :  are as follows:
> :   Document -- Element (maximum of one), ProcessingInstruction,
> :               Comment,  DocumentType
> :                         ^^^^^^^^^^^^

This is correct. A DocumentType is child of a Document.

> So, Should "DocumentType" object be Document's
> 1)child ?
> 2)attribute ?
> 3)both child and attribute ?
> 4)either child or attribute ?

It must be a child and be accessible through the doctype IDL attribute.
Arnaud  Le Hors  -  W3C, DOM Activity Lead  - 
Received on Friday, 21 May 1999 10:28:23 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:05 UTC