ABOUT US

|

SUPPORT

|

BLOG

DOWNLOADS    

 

 

 

 


 

 

W3C DOM

 

 

 

 

 

 

The WebRenderer Swing Edition supports the W3C DOM to level 2.

The W3C DOM is a tree-like structure that provides access to the underlying HTML document (see www.w3.org for more information). Because of the size and number of elements that have to be populated the DOM methods must be called after the NetworkEvent onDocumentComplete has fired. Calling DOM methods such as IBrowserCanvas getW3CDocument before onDocumentComplete may result in a DOM document that is not fully populated.

Creating a W3C DOM Document is done by calling getW3CDocument() on an IBrowserCanvas.
In the W3C DOM, most types inherit from Node. This is the type returned from getW3CDocument and will need to be cast to a Document.
Any navigation done in the DOM tree by getting children, parents or siblings will also return a Node type which needs to be cast into the exact type.

example:

browser.addNetworkListener(new NetworkAdapter() {
        public void onDocumentComplete(NetworkEvent e) {
                // Get the DOM Document
                Node node = browser.getW3CDocument();
                Document document = (Document)node;
        }
});


See the W3C DOM Java example for more details. 

 

 

 

 

 

 

 

 

Copyright JadeLiquid Software - www.jadeliquid.com