org.enhydra.xml.xhtml.dom.xerces
Class XHTMLDocumentBase

java.lang.Object
  |
  +--org.enhydra.apache.xerces.dom.NodeImpl
        |
        +--org.enhydra.apache.xerces.dom.ChildNode
              |
              +--org.enhydra.apache.xerces.dom.ParentNode
                    |
                    +--org.enhydra.apache.xerces.dom.CoreDocumentImpl
                          |
                          +--org.enhydra.apache.xerces.dom.DocumentImpl
                                |
                                +--org.enhydra.xml.xhtml.dom.xerces.XHTMLDocumentBase
All Implemented Interfaces:
Cloneable, Document, DocumentEvent, DocumentRange, DocumentTraversal, EventTarget, HTMLDocument, Node, NodeList, Serializable, XHTMLDocument
Direct Known Subclasses:
XHTMLDocumentImpl

public class XHTMLDocumentBase
extends org.enhydra.apache.xerces.dom.DocumentImpl
implements XHTMLDocument

Base class used to implements documents defined in terms of XHTML. This includes the full XHTML and XHTML modular documents. This defined all of the HTMLDocument methods plus a framework for creating elements, but no element definitions themselves.

See Also:
HTMLDocument, Serialized Form

Inner classes inherited from class org.enhydra.apache.xerces.dom.DocumentImpl
org.enhydra.apache.xerces.dom.DocumentImpl.EnclosingAttr, org.enhydra.apache.xerces.dom.DocumentImpl.LEntry
 
Inner classes inherited from class org.enhydra.apache.xerces.dom.ParentNode
org.enhydra.apache.xerces.dom.ParentNode.UserDataRecord
 
Fields inherited from class org.enhydra.apache.xerces.dom.DocumentImpl
eventListeners, iterators, mutationEvents, ranges, savedEnclosingAttr, serialVersionUID
 
Fields inherited from class org.enhydra.apache.xerces.dom.CoreDocumentImpl
actualEncoding, allowGrammarAccess, changes, docElement, docType, domNormalizer, encoding, errorChecking, fConfiguration, fDocumentURI, fFreeNLCache, fXPathEvaluator, identifiers, standalone, userData, version, xmlVersionChanged
 
Fields inherited from class org.enhydra.apache.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocument
 
Fields inherited from class org.enhydra.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.enhydra.apache.xerces.dom.NodeImpl
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
XHTMLDocumentBase()
          Constructor without document type.
XHTMLDocumentBase(DocumentType doctype)
          Constructor with document type.
 
Method Summary
 Node cloneNode(boolean deep)
           
 void close()
           
 Element createElement(String tagName)
           
 Element createElementNS(String namespaceURI, String qualifiedName)
           
 Element createElementNS(String namespaceURI, String qualifiedName, String localpart)
          Xerces-specific constructor.
 HTMLCollection getAnchors()
           
 HTMLCollection getApplets()
           
 HTMLElement getBody()
           
 String getCookie()
           
 Element getDocumentElement()
           
 String getDomain()
           
 NodeList getElementsByName(String elementName)
           
 NodeList getElementsByTagName(String tagName)
           
 NodeList getElementsByTagNameNS(String namespaceURI, String localName)
           
 HTMLCollection getForms()
           
 XHTMLElement getHead()
          Obtains the <HEAD> element in the document, creating one if does not exist before.
 HTMLCollection getImages()
           
 DOMImplementation getImplementation()
          override in order to return the correct dom implementation for XHTML
 HTMLCollection getLinks()
           
 String getReferrer()
           
 String getTitle()
           
 String getURL()
           
 void open()
           
 void setBody(HTMLElement newBody)
           
 void setBody(XHTMLElement newBody)
           
 void setCookie(String cookie)
           
 void setTitle(String newTitle)
           
 void write(String text)
           
 void writeln(String text)
           
 
Methods inherited from class org.enhydra.apache.xerces.dom.DocumentImpl
addEventListener, copyEventListeners, createEvent, createNodeIterator, createNodeIterator, createRange, createTreeWalker, createTreeWalker, deletedText, dispatchAggregateEvents, dispatchAggregateEvents, dispatchEvent, dispatchEventToSubtree, dispatchingEventToSubtree, getEventListeners, getMutationEvents, insertedNode, insertedText, insertingNode, modifiedAttrValue, modifiedCharacterData, modifyingCharacterData, removedAttrNode, removedNode, removeEventListener, removeNodeIterator, removeRange, removingNode, renamedAttrNode, renamedElement, replacedCharacterData, replacedNode, replacedText, replacingData, replacingNode, saveEnclosingAttr, setAttrNode, setEventListeners, setMutationEvents, splitData
 
Methods inherited from class org.enhydra.apache.xerces.dom.CoreDocumentImpl
, abort, adoptNode, callUserDataHandlers, callUserDataHandlers, changed, changes, checkDOMNSErr, checkNamespaceWF, checkQName, clearIdentifiers, clone, cloneNode, createAttribute, createAttributeNS, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createDocumentType, createElementDefinition, createEntity, createEntityReference, createNotation, createProcessingInstruction, createTextNode, freeNodeListCache, getAsync, getBaseURI, getDoctype, getDocumentURI, getDomConfig, getElementById, getEncoding, getErrorChecking, getFeature, getIdentifier, getIdentifiers, getInputEncoding, getNodeListCache, getNodeName, getNodeNumber, getNodeNumber, getNodeType, getOwnerDocument, getStandalone, getStrictErrorChecking, getTextContent, getUserData, getUserData, getUserDataRecord, getVersion, getXmlEncoding, getXmlStandalone, getXmlVersion, importNode, insertBefore, isKidOK, isNormalizeDocRequired, isValidQName, isXML11Version, isXMLName, isXMLVersionChanged, load, loadXML, normalizeDocument, putIdentifier, removeChild, removeIdentifier, removeUserDataTable, renameNode, replaceChild, saveXML, setAsync, setDocumentURI, setEncoding, setErrorChecking, setInputEncoding, setStandalone, setStrictErrorChecking, setTextContent, setUserData, setUserData, setUserDataTable, setVersion, setXmlEncoding, setXmlStandalone, setXmlVersion, undeferChildren
 
Methods inherited from class org.enhydra.apache.xerces.dom.ParentNode
checkNormalizationAfterInsert, checkNormalizationAfterRemove, getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getTextContent, hasChildNodes, hasTextContent, internalInsertBefore, internalRemoveChild, isEqualNode, item, lastChild, lastChild, normalize, ownerDocument, setOwnerDocument, setReadOnly, synchronizeChildren
 
Methods inherited from class org.enhydra.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSibling, parentNode, previousSibling
 
Methods inherited from class org.enhydra.apache.xerces.dom.NodeImpl
addEventListener, appendChild, compareDocumentPosition, compareTreePosition, dispatchEvent, getAttributes, getContainer, getElementAncestor, getLocalName, getNamespaceURI, getNodeValue, getPrefix, getReadOnly, getUserData, getUserData, getUserDataRecord, hasAttributes, hasStringValue, hasStringValue, internalIsIgnorableWhitespace, isDefaultNamespace, isFirstChild, isFirstChild, isIdAttribute, isIdAttribute, isIgnorableWhitespace, isNormalized, isNormalized, isOwned, isOwned, isReadOnly, isReadOnly, isSameNode, isSpecified, isSpecified, isSupported, lookupNamespacePrefix, lookupNamespaceURI, lookupPrefix, needsSyncChildren, needsSyncChildren, needsSyncData, needsSyncData, removeEventListener, setNodeValue, setPrefix, setUserData, setUserData, synchronizeData, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.html.HTMLDocument
getElementById
 
Methods inherited from interface org.w3c.dom.Document
adoptNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createEntityReference, createProcessingInstruction, createTextNode, getDoctype, getDocumentURI, getDomConfig, getInputEncoding, getStrictErrorChecking, getXmlEncoding, getXmlStandalone, getXmlVersion, importNode, normalizeDocument, renameNode, setDocumentURI, setStrictErrorChecking, setXmlStandalone, setXmlVersion
 
Methods inherited from interface org.w3c.dom.Node
appendChild, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 

Constructor Detail

XHTMLDocumentBase

public XHTMLDocumentBase()
Constructor without document type.

XHTMLDocumentBase

public XHTMLDocumentBase(DocumentType doctype)
Constructor with document type.
Method Detail

getDocumentElement

public Element getDocumentElement()
Specified by:
getDocumentElement in interface Document
Overrides:
getDocumentElement in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#getDocumentElement

getHead

public XHTMLElement getHead()
Obtains the <HEAD> element in the document, creating one if does not exist before. The <HEAD> element is the first element in the <HTML> in the document. The <HTML> element is obtained by calling getDocumentElement(). If the element does not exist, one is created.

Called by getTitle(), setTitle(java.lang.String), getBody() and setBody(org.enhydra.xml.xhtml.dom.XHTMLElement) to assure the document has the <HEAD> element correctly placed.

Returns:
The <HEAD> element

getTitle

public String getTitle()
Specified by:
getTitle in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#getTitle

setTitle

public void setTitle(String newTitle)
Specified by:
setTitle in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#setTitle

getBody

public HTMLElement getBody()
Specified by:
getBody in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#getBody

setBody

public void setBody(XHTMLElement newBody)
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#setBody

setBody

public void setBody(HTMLElement newBody)
Specified by:
setBody in interface HTMLDocument

getElementsByName

public NodeList getElementsByName(String elementName)
Specified by:
getElementsByName in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#getElementsByName

getElementsByTagName

public final NodeList getElementsByTagName(String tagName)
Specified by:
getElementsByTagName in interface Document
Overrides:
getElementsByTagName in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#getElementsByTagName

getElementsByTagNameNS

public final NodeList getElementsByTagNameNS(String namespaceURI,
                                             String localName)
Specified by:
getElementsByTagNameNS in interface Document
Overrides:
getElementsByTagNameNS in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#getElementsByTagNameNS

createElementNS

public Element createElementNS(String namespaceURI,
                               String qualifiedName,
                               String localpart)
                        throws DOMException
Xerces-specific constructor. "localName" is passed in, so we don't need to create a new String for it.
Overrides:
createElementNS in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
Parameters:
namespaceURI - The namespace URI of the element to create.
qualifiedName - The qualified name of the element type to instantiate.
localpart - The local name of the element to instantiate.
Returns:
Element A new Element object with the following attributes:
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.

createElementNS

public Element createElementNS(String namespaceURI,
                               String qualifiedName)
Specified by:
createElementNS in interface Document
Overrides:
createElementNS in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#createElementNS

createElement

public Element createElement(String tagName)
                      throws DOMException
Specified by:
createElement in interface Document
Overrides:
createElement in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#createElement

getReferrer

public String getReferrer()
Specified by:
getReferrer in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#getReferrer

getDomain

public String getDomain()
Specified by:
getDomain in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#getDomain

getURL

public String getURL()
Specified by:
getURL in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#getURL

getCookie

public String getCookie()
Specified by:
getCookie in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#getCookie

setCookie

public void setCookie(String cookie)
Specified by:
setCookie in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#setCookie

getImages

public HTMLCollection getImages()
Specified by:
getImages in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#getImages

getApplets

public HTMLCollection getApplets()
Specified by:
getApplets in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#getApplets

getLinks

public HTMLCollection getLinks()
Specified by:
getLinks in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#getLinks

getForms

public HTMLCollection getForms()
Specified by:
getForms in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#getForms

getAnchors

public HTMLCollection getAnchors()
Specified by:
getAnchors in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#getAnchors

open

public void open()
Specified by:
open in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#open

close

public void close()
Specified by:
close in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#close

write

public void write(String text)
Specified by:
write in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#write

writeln

public void writeln(String text)
Specified by:
writeln in interface HTMLDocument
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#writeln

cloneNode

public Node cloneNode(boolean deep)
Specified by:
cloneNode in interface Node
Overrides:
cloneNode in class org.enhydra.apache.xerces.dom.DocumentImpl
See Also:
org.enhydra.apache.html.dom.HTMLDocumentImpl#cloneNode

getImplementation

public DOMImplementation getImplementation()
override in order to return the correct dom implementation for XHTML
Specified by:
getImplementation in interface Document
Overrides:
getImplementation in class org.enhydra.apache.xerces.dom.DocumentImpl
See Also:
DocumentImpl.getImplementation()


Copyright © 1999-2002 Mark Diekhans, enhydra.org. All Rights reserved.