Document Object Model Layer

The DOM is extremely simple. The hope is that by keeping it simple, it will be possible to represent as many different file types as possible. To this end, all interfaces to methods in the DOM Layer should deal with Objects as much as possible. Even assuming that the contents of a document will be text should be avoided. It should be possible to the DOM to represent even binary file formats.

Possible Class/Interfaces

pedantiWEB.dom.Document
A class which contains all the Nodes in the document which was parsed.
public interface Document extends Element
public String getContentType();
public void setContentType();
Get/set a String which describes the type of the data that was used to create this document. This could be a MIME type string.
public Enumeration renderings();
Get a list of possible types which this document object could be rendered as. (Hint: for most documents which are text-only, once they've been converted into this document structure they become renderable as XML documents.) Another use for this is for binary document which may have multiple file-formats (and multiple parsers) but all having the same internal representation.

This could be a list of MIME types, and the browser could use these strings to choose how to render it. The renderings should be in order from best to worst choice. The first choice should (but doesn't have to) be the same as the conentType.

public void addRendering(String);
Add a type to the renderings list.
pedantiWEB.dom.Element
An Element contains two things; the Attributes and Contents. Attributes could be a Hashtable while Contents could be a Vector.
public interface Element
public String getName();
public void setName(String);
Get/set the name of the element.
public Object getAttribute(Object attribute);
public void putAttribute(Object attribute, Object value);
Get/put attribute.
public Enumeration attributes();
Get and Enumeration of the attributes.
public void addContent(Object);
Add something to the contents of this element.
public Enumeration contents();
Get an Enumeration of the contents.

Go to pedantiWEB, a GPL, Java web browser

Bill Bereza - bereza@pobox.com
<URL:http://www.pobox.com/~bereza/pedantiWEB/dom.html>

Last Updated on Wednesday, December 03, 1997.

$Id: dom.html,v 1.2 1997/12/12 16:35:48 bereza Exp bereza $

HTML Checked!