I have a problem in Event handler registration.
I want to add an event handler to some node, say, "someNode" using Java
Binding.
but, after parsing, the return value of parser.getDocument() (parser is an
instance of DOMParser),
say, document, is a Document's instance.
In addition the return value of
"document.getElementsByTagName("head").item(0)"
is an instance of Node, not of NodeImpl where EventTarget interface is
implemented.
Therefore the addEventListener method is not found or can't be accessed
So I got an error.
The following is the code that I used.
I'm xerces newbie so I'm not sure that is correct or not.
//
Node testTarget = document.getElementsByTagName("head").item(0);
EventListener TestEventListener = new EventListenerImpl();
testTarget.addEventListener( "mutation", TestEventListener, false );
//
And I got an error like the following
//
ScriptingTest.java:108: cannot resolve symbol
symbol : method addEventListener
(java.lang.String,org.w3c.dom.events.EventListener,boolean)
location: interface org.w3c.dom.Node
testTarget.addEventListener( "mutation", TestEventListener, false );
^
1 error
//
Please help me, I've never been answered all the question that I posted this
mailing list. :-(
-- Nam