File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes XmlBeans and DOM Listener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XmlBeans and DOM Listener" Watch "XmlBeans and DOM Listener" New topic

XmlBeans and DOM Listener

Robert Harvey

Joined: Nov 18, 2011
Posts: 8
I have an application UI that uses XmlBeans to parse an XML document and display the parsed "XmlObjects" in a exploreresque treeview. XmlBeans doesn't provide much support for eventing so I am grabbing the "Document's" DomNode to employ DOM's eventing support. From there, I am getting the document's root element via getDocumentElement(). I then try to cast this element to EventTarget so I can add to the interface my However, a ClassCastException is occurring where the cast occurs from Element to EventTarget. Below is a snippet:

Any help is much appreciated - Thanks!
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13027
From the EventTarget documentation, this would appear to indicate that your DOM implementation does not implement the EventTarget interface.

Robert Harvey

Joined: Nov 18, 2011
Posts: 8
Thanks Bill - I was afraid that this was the case.
I agree. Here's the link:
subject: XmlBeans and DOM Listener
It's not a secret anymore!