You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Torkel Dominique <to...@hotsip.com> on 2001/03/26 13:44:11 UTC

DOM Events problem

Hi,

I'm using xerces-J 1.3.0 and have a problem with DOM events.
I have the following part of an XML document, which I parse into a DOM tree:

<a>
 <b c="10">yes</b>
</a>

Now I register an EventListener to node a:

node_a.addEventListener("DOMSubtreeModified", eventLstener, false);

If I now change the value of element "b" (e.g. from "yes" to "no"), I
receive an event as expected.
But, if I change the value of attribute "c" (e.g. from "10" to "11"), I do
not receive any event.(WHY??)

If I, on the other hand, listens for a "DOMAttrModified" event,

node_a.addEventListener("DOMAttrModified", eventLstener, false);

and change the value of attribute "c", I receive an event. After reading the
DOM Events spec, my understanding is that the "DOMSubtreeModified" event
should be a general event type which can be used instead of any of the other
mutation events, including the "DOMAttrModified" event. If this is correct
then why don't I receive the event in the first example?

Even more funny is that if I listen to both "DOMSubtreeModified" events and
"DOMAttrModified" events, I receive two events when I change the value of
attribute "c", one "DOMSubtreeModified" event and one "DOMAttrModified"
event! Why is this?

Is there something that I have misunderstood?

Thanks,
Torkel Dominique
Hotsip
Sweden


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org