tags:

views:

29

answers:

1

Is there any standardized way (not language dependent, I need at least C++, Java and Ruby) of listening for changes in a DOM-document? I would like to have a function called every time a node's attributes change, a node gets renamed, deleted, etcetera.

I found the Handlers for UserData, however those don't allow me to listen for e.g. changes in attribute. Right now it seems to me the only possibility is implementing my own DOM. Any ideas?

A: 

You want to add a handler for Mutation Events. I've used these in Firefox, although I don't know what availability they have in libraries for the languages you mention.

http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-mutationevents

Matthew Wilson
Thank you, that looks quite good. However xerces-c which was the library I used up to now for C++ doesn't seem to support those events, I might have to look for something else.
lucas clemente