[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How can i use dom event to detect any modification to cert

  • To: =?UTF-8?Q?"=E5=90=B4=E6=B9=96"?= <wuhu@i...>
  • Subject: Re: How can i use dom event to detect any modification to certain xml docs?
  • From: Chris Burdess <dog@b...>
  • Date: Wed, 14 Dec 2005 14:39:45 +0000
  • Cc: "'xml-dev@l...' " <xml-dev@l...>
  • In-reply-to: <E1EmXX8-00074p-00@d...>
  • References: <E1EmXX8-00074p-00@d...>

dom event
吴湖 wrote:
> I 'v read a lot of w3c specs about dom event.
> But still I don't know how to create or invoke dom events in java.
> java 1.5 does have the org.w3c.dom.events package which contains lots 
> of dom event interfaces, but how to implement them seems to be a 
> question that we programmers should answer. Am I right? or there 'r 
> already any implementation of these interfaces in java?
> Any help would mean a lot to me!

You create an event by casting the Document to a DocumentEvent and 
calling createEvent.

You dispatch an event to a node in the tree by casting it to an 
EventTarget and calling dispatchEvent on it.

You receive events by registering yourself as an EventListener on an 
EventTarget (addEventListener), whereupon you will receive events 
dispatched to that target (and possibly its descendents).

You can determine whether the implementation supports events by getting 
the DOMImplementation (Document.getImplementation) and calling 
hasFeature("events", "2.0") (or "uievents", "mutationevents", 
"htmlevents").

GNU Classpath, used in gcj, jamvm, sablevm, kaffe, cacao, and most 
other free JVMs, supports DOM events. I can't speak for other 
implementations.
-- 
Chris Burdess


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.