W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2000

Re: Entity nodes

From: Joseph Kesselman/Watson/IBM <keshlam@us.ibm.com>
Date: Tue, 5 Sep 2000 09:43:04 -0400
To: "Hari Haran Subramanian" <haran.hari@wipro.com>
Cc: "www-dom@w3.org" <www-dom@w3.org>
Message-ID: <OF87388D06.8D5F3CBE-ON85256951.004A477C@pok.ibm.com>

>"The DOM Level 2 does not support editing Entity nodes; ..."

At this time, Entity nodes and their descendents (the description of an
Entity's value) are always read-only, and the DOM spec offers no way to
alter them. Theoretically, since you Entities are stored in a NamedNodeMap,
you could replace one Entity with another -- but since there is no
createEntity method, there is no promise that this will work. And if you do
somehow manage to step outside the limits of the DOM and change the
Entity's value, there is no promise that references to this Entity in the
main document which reference this Entity will have their values updated to
reflect the change.

So if you really want to edit part of the document which was represented by
an entity, the best you can do is to explicitly clone of the Entity's
contents, edit this clone tree (which will _not_ be read-only), and then
find and replace all the references to this Entity with the new value. All
of that has to be done in application or middleware code.

DOM Level 3's "Content Model' chapter may or may not  make entities
editable. The largest challenge is determining how and when changes to the
entity definition are published into the main DOM tree, as this may have
significant side effects if the user has pointers into the EntityReference.

Joe Kesselman  / IBM Research
Received on Tuesday, 5 September 2000 09:43:08 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:07 UTC