- From: DaeHoon Zee <zeedh@sbr.net>
- Date: Wed, 4 Nov 1998 10:44:30 +0900
- To: "'Ray Whitmer'" <ray@imall.com>, DOM List <www-dom@w3.org>
Thanks a lot for your reply. Let me ask a little more. 1. Is it possible a Attribute have 'value', 'Text', 'Entity Reference' simultaneously ? And How it is represented by XML as a text? 2. Is it possible a Attribute have several 'Text' Nodes or 'Entity Reference' Nodes? And How these multi-values can be represented by XML as a text? -----Original Message----- From: Ray Whitmer [SMTP:ray@imall.com] Sent: Tuesday, November 03, 1998 9:07 PM To: DOM List Subject: Re: Attribute is a kind of Node? DaeHoon Zee wrote: > Please somebody explain to me, why Attribute shoulld be a Node. > Is it possible Attibute have some child Nodes? > What will be happen if insertBefore() is called like below? > myNode.insertNode(myAttribute, prevNode); > > If the answers are 'No' and 'Error', again, why Attribute shoulld be a Node? After asking whether Attr can have children (which it can), your example tries to use an Attr as a child node, which it can not be. This is not unique to Attr. Also Document and DocumentFragment are never child nodes. But each of these three can be the root of a hierarchy of values. Section 1.1.1 in the recommendation gives a list of which nodes are parents and children of which other nodes. Attr has to be a node so that it can have entity references in addition to text as children. But it is never a child node, which would make as little sense as making a Document or DocumentFragment a child node. There are getAttribute and setAttribute functions on Element so that users who do not need to manipulate entity references inside attributes can ignore attributes as nodes. Some implementations may never actually construct nodes for the attribute values if the nodes are never explicitly requested. Ray Whitmer ray@imall.com
Received on Tuesday, 3 November 1998 20:39:23 UTC