Implements an HTML document. Provides access to the top level element in the
document, its body and title.
Several methods create new nodes of all basic types (comment, text, element,
etc.). These methods create new nodes but do not place them in the document
tree. The nodes may be placed in the document tree using
org.w3c.dom.Node.appendChild
or
org.w3c.dom.Node.insertBefore
, or
they may be placed in some other document tree.
Note: <FRAMESET> documents are not supported at the moment, neither
are direct document writing (
open()
,
write(String)
) and HTTP attribute
methods (
getURL()
,
getCookie()
).
cloneNode
public Node cloneNode(boolean deep)
- cloneNode in interface org.apache.xerces.dom.DocumentImpl
createAttribute
public Attr createAttribute(String name)
throws DOMException
Creates an Attribute having this Document as its OwnerDoc.
Overrides DocumentImpl.createAttribute
and returns
and attribute whose name is lower case.
- createAttribute in interface org.apache.xerces.dom.CoreDocumentImpl
name
- The name of the attribute
- An attribute whose name is all lower case
createElement
public Element createElement(String tagName)
throws DOMException
- createElement in interface org.apache.xerces.dom.CoreDocumentImpl
createElementNS
public Element createElementNS(String namespaceURI,
String qualifiedName)
- createElementNS in interface org.apache.xerces.dom.CoreDocumentImpl
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.
- createElementNS in interface org.apache.xerces.dom.CoreDocumentImpl
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.
- Element A new Element object with the following attributes:
getAnchors
public HTMLCollection getAnchors()
getApplets
public HTMLCollection getApplets()
getBody
public HTMLElement getBody()
getCookie
public String getCookie()
getDocumentElement
public Element getDocumentElement()
- getDocumentElement in interface org.apache.xerces.dom.CoreDocumentImpl
getDomain
public String getDomain()
getElementById
public Element getElementById(String elementId)
- getElementById in interface org.apache.xerces.dom.CoreDocumentImpl
getElementsByName
public NodeList getElementsByName(String elementName)
getElementsByTagName
public final NodeList getElementsByTagName(String tagName)
- getElementsByTagName in interface org.apache.xerces.dom.CoreDocumentImpl
getElementsByTagNameNS
public final NodeList getElementsByTagNameNS(String namespaceURI,
String localName)
- getElementsByTagNameNS in interface org.apache.xerces.dom.CoreDocumentImpl
getForms
public HTMLCollection getForms()
getHead
public HTMLElement 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(String)
,
getBody()
and
setBody(HTMLElement)
to assure the document has the <HEAD> element
correctly placed.
getImages
public HTMLCollection getImages()
getLinks
public HTMLCollection getLinks()
getReferrer
public String getReferrer()
getTitle
public String getTitle()
getURL
public String getURL()
setBody
public void setBody(HTMLElement newBody)
setCookie
public void setCookie(String cookie)
setTitle
public void setTitle(String newTitle)
write
public void write(String text)
writeln
public void writeln(String text)