Thanks for your reply Stefan.

I hadn't really read the manual, had just been working with DOM level 2 in
java before, and the fact that attributes are not children of elements,
puzzled me. But after reading the DOM level 2 spesification, it may seem
that you are right.

To me, the fact that attributes are not children of the element they are
contain within seems to defy the purpose of DOM, which is to represent
the entire document as a tree/trees depending on the documenttype.
This tree should be made up of Node interfaces, and as attributes inherit
from the Node interface (like element, text and so on) it seems odd to me
that the attribute is not part of the dom tree.

But I guess it is easier to rewrite my code according to the
"shortcommings" in dom than to change DOM level 2 and subsequently to
change the libxml-libraries :-)

vennlig hilsen
Øyvind

On Thu, 30 Jan 2003 [EMAIL PROTECTED] wrote:

> Hello
> As far as I rememeber according to DOM Level 2 Elementnodes contain
> Attributenodes but the Attributenode has no association with its
> Elementnode meaning you can't tell from an Attributenode which Elementnode
> it belongs to unless you remember it in your code. Thus an Attributenode
> is not part of the Domtree as an Elementnode and will not be returned as a
> Child of that Node. The only way to retrieve Attributenodes is by going
> throught the Elementnode and retrieving the attributes explicitly.
> In other words Attributenodes are special nodes which do not get nested in
> the DOMtree as children of their corresponding Elementnode. This leaves
> space for optimizing the DOMTree by inserting a single attributenode for
> multiple Elementnodes. (At least that is what I'm guessing...)
>
> Please correct me if I'm mistaken
>
> Stefan


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to