Usage of DOM Java ?

I'm working on Java tools which handle documents from a browser.
I used DOM in order to make my tools independent of the browser.  

+-------+     +-----+---------+
| my    | <=> | API | browser |
| tools |     | DOM |         |
+-------+     +-----+---------+

To traverse the tree of a document HTML, I use a specific method to
get the root node and traverse the tree.
for example, if I want the TITLE Element:

  Object dc = myBrowser.getCurrentDocumentContext();
  Object title = ((w3c.dom.DocumentContext)dc).getDocument().
			getElementsByTagName("TITLE");

The systematic cast is painful, but it's possible.
But, how to create or to append a new node ?

I think if DOM wants to propose API for Java, it is necessary to 
include classes.  

This subject has been already discussed by Mark L. Fussell.
Can you light us? 


Laurent ROUVET.

Received on Monday, 29 December 1997 17:28:31 UTC