OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

cgmo-webcgm message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Questionw: MAY versus MUST; Attr


Benoit, all --

Focusing on clarifying one particular point...

At 03:11 PM 5/26/2005 -0400, Benoit Bezaire wrote:
Thursday, May 26, 2005, 12:39:51 PM, Lofton wrote:
[...]
LH> [Btw, editorial, in the sentence, "All nodes, except WebCGMPicture may have
LH> a parent.":  s/may// , correct?]
False... but it should be "All nodes, except WebCGMPicture and
WebCGMAttr may have a parent."

Q.1:  How can a node (other than the alleged root, Picture, or Attr according to the above) *not* have a parent? 

Q.2:  When you added Attr, it confused me.  I was thinking in Xpath/XSLT terms, where attributes are indeed children of the elements they belong to (and those elements are indeed the parents of their attributes).  So I looked at DOM2, which explains the different model (p.51, Interface Attr):

[[[
The Attr interface represents an attribute in an Element [p.52] object. Typically the allowable values for the attribute are defined in a document type definition.

Attr objects inherit the Node [p.34] interface, but since they are not actually child nodes of the element they describe, the DOM does not consider them part of the document tree. Thus, the Node attributes parentNode, previousSibling, and nextSibling have a null value for Attr objects. The DOM takes the view that attributes are properties of elements rather than having a separate identity from the elements they are associated with; this should make it more efficient to implement such features as default attributes associated with all elements of a given type.  Furthermore, Attr nodes may not be immediate children of a DocumentFragment [p.24] .  However, they can be associated with Element [p.52] nodes contained within a DocumentFragment. In short, users and implementors of the DOM need to be aware that Attr nodes have some things in common with other objects inheriting the Node interface, but they also are quite distinct.
]]]

I guess you have applied the same principle to WebCGMAttr?

Am I the only one to whom these points were not obvious in Ch.5?  (Both the structure of the document tree in terms of parents/children, and the rules on the particular WebCGMNode attributes like parentNode.)

Regards,
-Lofton.

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]