Re: Mixed level 1 and level 2 nodes woes

                                                                                                               
                                                                                                               
                                                                                                               


On Wednesday, 07/17/2002 at 04:31 ZE2, "Sander Bos" <sander@x-hive.com>
wrote:
> I have some questions about documents with mixed level 1 and level 2
> nodes.

You can pass a Level 2 document down to Level 1 code and it will function
as a Level 1 DOM. You can _not_ create non-namespaced nodes and pass it
back up to Level 2 code and expect correct operation. This is by design;
the non-namespaced calls can be considered deprecated except for purely
Level 1 applications.

So you're asking about correct behavior for something that should never be
allowed to happen. Which is why it's undefined.


> I already know the standard answer: "Don't mix the two kinds of nodes
> then."
> That is very nice, but users are going to do that if you give them a
> chance

Users are "going to do" all sorts of things we don't support. That doesn't
necessarily mean we should support them.

> - createElement, createAttribute and setAttribute should create DOM
>level 2 nodes when the document element of the document is a level 2
>node (so localName should be set in that case).

We did discuss this during the design of DOM Level 2. Your proposed
solution is one of those which was placed on the table at that time. It was
rejected, partly because some folks insisted that a level 1 node *must*
have no prefix and no localname.

Changing this probably exceeds the bounds that could be handled as an
erratum. It's a significant redesign. Much as I would have preferred not to
have the distinction between "level 1 nodes" and "level 2 nodes", I think
you're going to face major objections to changing that design now.

______________________________________
Joe Kesselman  / IBM Research

Received on Wednesday, 17 July 2002 11:17:32 UTC