OverDOM is a Java implementation of the W3C DOM, layered over a Web browser's native implementation.
OverDOM provides applets with access to the browser's loaded document, through a familiar Java binding. It aims to support:
· DOM level 3
· XML and HTML
· XML namespaces
· events
· traversal & range
Usage:
import netscape.javascript.JSObject;
import org.w3c.dom.*;
import org.w3c.dom.events.*;
import org.w3c.dom.ranges.*;
import org.w3c.dom.traversal.*;
import textbender.g.hold.SpoolT;
import textbender.o.browser.overdom.*;
· · ·
SpoolT spool = new SpoolT();
OverDOM overDOM = new OverDOM( spool );
WindowO window = JSObjectOverlay.getWindow( overDOM, applet );
// DOM level 3
Document document = window.getDocument();
// events
EventTarget eventRegistry = (EventTarget)document;
// traversal
TreeWalker walker = ((DocumentTraversal)document).createTreeWalker( · · · );
// range
Range range = ((DocumentRange)document).createRange();
· · ·
spool.unwind(); // release overDOM (when applet destroyed, or earlier)
Requirements:
· Requires textbender.jar. It contains the OverDOM runtime code. Add it to your classpath.
· Requires jre/lib/plugin.jar, or equivalent from your JDK. It contains the JSObject (Java-to-JavaScript bridge) code. Add it to your compile-time classpath. (It is automatically added to the runtime classpath by the Java Plug-In.)
· Requires a mayscript attribute on the applet.
Limitations:
· Implementation is incomplete. Only the methods needed by textbender are coded. Other methods throw UnsupportedOperationException, till someone implements them. (In most cases, the implementation is trivial. See the source code.)
· Tested only with Sun's Java Plug-In, vanilla Mozilla and FireFox. In theory, any runtime with a JSObject bridge (most modern browsers) will be OK.
What's New in This Release:
· Additional methods were implemented for the interfaces Document and Node.
Product's homepage