Re: Call for unified tree model

First, I want to thank you for the amount of work you put in to this. 
I'm still thinking through the ramifications.

On 26 Jan 00, at 16:09, Nils Klarlund wrote:


> 3. MORE MARKUP AND TEXT CONFUSION
> 
> In DOM, we read
> 
>    "If there is no markup inside an element's content, the text is   (3)
>     contained in a single object implementing the Text interface that
>     is the only child of the element."
> 
> But, the sentence that follows says:
> 
>    "If there is markup, it is parsed into the information items    (3')
>     (elements, comments, etc.) and Text nodes that form the list of
>     children of the element."
> 
> So, in this sentence, markup now means markup in the XML 1.0 sense +
> character data. 

No, it doesn't, so I guess we need to rewrite this sentence to make 
the meaning clear. And thanks for reminding me about the 
difference in treatment of text. To explain what the DOM currently 
does, the sentences you quoted should be changed to something 
like (with additions in []):

"If there is no markup inside an element's content, the text is  
contained in a single object implementing the Text interface that is 
the only child of the element. If there is markup [in the element's 
content, i.e. the element has mixed content], it is parsed into the 
information items (elements, comments, etc. [, but not including 
character-level information items]) and Text nodes that form the list 
of children of the element."

Does that make it clearer?

> Also, since information items, in fact, include the
> character data, the sentence says that both the fine-grained character
> information items and some corresponding Text nodes somehow are
> included in the list of children.

It shouldn't; the Text nodes are the only way in the DOM of 
representing character data. 

For the rest of your proposals; I think there will be a lot of 
resistance to changes to DOM Level 1. And we did discuss the 
issue of whether attributes are children of elements at great length; 
I think you will find this is one issue where people's opinions are 
unlikely to change. So I, for example, would disagree with 
"An element node may have child nodes of
   various types that represent content, attributes, and namespace
   declarations."

Saying attributes are children, but that the getNext etc methods 
should be changed to just return content nodes (and not attributes) 
seems to not make much sense to me from the DOM perspective. 

I see the simplification in terminology, and to have all the XML-
related specs use the same concepts would help, but I'm not yet 
convinced this is the answer.

Lauren

Received on Friday, 28 January 2000 13:55:44 UTC