xml.dom.xhtml
Class XhtmlDomImpl

java.lang.Object
  |
  +--xml.dom.DomImpl
        |
        +--xml.dom.xhtml.XhtmlDomImpl
All Implemented Interfaces:
DOMImplementation, HTMLDOMImplementation

public class XhtmlDomImpl
extends DomImpl
implements HTMLDOMImplementation

XHTML subclass of "DomImplementation", supporting the HTML DOM interfaces that make the most sense in the XHTML world.

Version:
$Date: 2000/07/15 00:58:13 $
Author:
David Brownell

Field Summary
static java.lang.String xhtmlNamespace
          This is the namespace URI for XHTML, as defined in the 24-Nov-1999 working draft.
 
Constructor Summary
XhtmlDomImpl()
          Constructs a DOMImplementation object.
 
Method Summary
 Document createDocument(java.lang.String namespaceURI, java.lang.String rootName, DocumentType doctype)
          DOM L2 Creates and returns a Document, populated only with a root element and optionally a document type (if that was provided).
 HTMLDocument createHTMLDocument(java.lang.String title)
          DOM L2 (HTML) Creates and returns an XHTML document object, populated with the minimal "html", "head", "title", and "body" elements.
 
Methods inherited from class xml.dom.DomImpl
createDocumentType, hasFeature
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.DOMImplementation
createDocumentType, hasFeature
 

Field Detail

xhtmlNamespace

public static final java.lang.String xhtmlNamespace
This is the namespace URI for XHTML, as defined in the 24-Nov-1999 working draft. XHTML defines only one namespace; applicable validity rules (defined in the DTD) are distinct from namespaces. That is, namespaces define only vocabularies, not policies for their usage (such as precluding <font ...> tags in general, or in certain contexts).
Constructor Detail

XhtmlDomImpl

public XhtmlDomImpl()
Constructs a DOMImplementation object.
Method Detail

createDocument

public Document createDocument(java.lang.String namespaceURI,
                               java.lang.String rootName,
                               DocumentType doctype)
DOM L2 Creates and returns a Document, populated only with a root element and optionally a document type (if that was provided).
Specified by:
createDocument in interface DOMImplementation
Overrides:
createDocument in class DomImpl
Following copied from interface: org.w3c.dom.DOMImplementation
Parameters:
namespaceURIThe - namespace URI of the document element to create.
qualifiedNameThe - qualified name of the document element to be created.
doctypeThe - type of document to be created or null. When doctype is not null, its Node.ownerDocument attribute is set to the document being created.
Returns:
A new Document object.
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character.
NAMESPACE_ERR: Raised if the qualifiedName is malformed, if the qualifiedName has a prefix and the namespaceURI is null, or if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from " http://www.w3.org/XML/1998/namespace" .
WRONG_DOCUMENT_ERR: Raised if doctype has already been used with a different document or was created from a different implementation.

createHTMLDocument

public HTMLDocument createHTMLDocument(java.lang.String title)
DOM L2 (HTML) Creates and returns an XHTML document object, populated with the minimal "html", "head", "title", and "body" elements. It also has a namespace declaration so that the default namespace is the XHTML namespace.
Specified by:
createHTMLDocument in interface HTMLDOMImplementation
Following copied from interface: org.w3c.dom.html.HTMLDOMImplementation
Parameters:
title - The title of the document to be set as the content of the TITLE element, through a child Text node.
Returns:
A new HTMLDocument object.

Source code is GPL'd at http://xmlconf.sourceforge.net.