public class HTMLDocumentImpl
extends org.apache.xerces.dom.DocumentImpl
implements org.w3c.dom.html.HTMLDocument
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 org.w3c.dom.Node cloneNode(boolean deep)
- cloneNode in interface org.w3c.dom.Node
- cloneNode in interface org.apache.xerces.dom.DocumentImpl
close
public void close()
- close in interface org.w3c.dom.html.HTMLDocument
createAttribute
public org.w3c.dom.Attr createAttribute(String name)
throws org.w3c.dom.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.w3c.dom.Document
- createAttribute in interface org.apache.xerces.dom.CoreDocumentImpl
name
- The name of the attribute
- An attribute whose name is all lower case
createElement
public org.w3c.dom.Element createElement(String tagName)
throws org.w3c.dom.DOMException
- createElement in interface org.w3c.dom.Document
- createElement in interface org.apache.xerces.dom.CoreDocumentImpl
createElementNS
public org.w3c.dom.Element createElementNS(String namespaceURI,
String qualifiedName)
- createElementNS in interface org.w3c.dom.Document
- createElementNS in interface org.apache.xerces.dom.CoreDocumentImpl
createElementNS
public org.w3c.dom.Element createElementNS(String namespaceURI,
String qualifiedName,
String localpart)
throws org.w3c.dom.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.
- Element A new Element object with the following attributes:
org.w3c.dom.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified
name contains an invalid character.
getAnchors
public org.w3c.dom.html.HTMLCollection getAnchors()
- getAnchors in interface org.w3c.dom.html.HTMLDocument
getApplets
public org.w3c.dom.html.HTMLCollection getApplets()
- getApplets in interface org.w3c.dom.html.HTMLDocument
getBody
public org.w3c.dom.html.HTMLElement getBody()
- getBody in interface org.w3c.dom.html.HTMLDocument
getCookie
public String getCookie()
- getCookie in interface org.w3c.dom.html.HTMLDocument
getDocumentElement
public org.w3c.dom.Element getDocumentElement()
- getDocumentElement in interface org.w3c.dom.Document
- getDocumentElement in interface org.apache.xerces.dom.CoreDocumentImpl
getDomain
public String getDomain()
- getDomain in interface org.w3c.dom.html.HTMLDocument
getElementById
public org.w3c.dom.Element getElementById(String elementId)
- getElementById in interface org.w3c.dom.html.HTMLDocument
- getElementById in interface org.w3c.dom.Document
- getElementById in interface org.apache.xerces.dom.CoreDocumentImpl
getElementsByName
public org.w3c.dom.NodeList getElementsByName(String elementName)
- getElementsByName in interface org.w3c.dom.html.HTMLDocument
getElementsByTagName
public final org.w3c.dom.NodeList getElementsByTagName(String tagName)
- getElementsByTagName in interface org.w3c.dom.Document
- getElementsByTagName in interface org.apache.xerces.dom.CoreDocumentImpl
getElementsByTagNameNS
public final org.w3c.dom.NodeList getElementsByTagNameNS(String namespaceURI,
String localName)
- getElementsByTagNameNS in interface org.w3c.dom.Document
- getElementsByTagNameNS in interface org.apache.xerces.dom.CoreDocumentImpl
getForms
public org.w3c.dom.html.HTMLCollection getForms()
- getForms in interface org.w3c.dom.html.HTMLDocument
getHead
public org.w3c.dom.html.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.
- The <HEAD> element
getImages
public org.w3c.dom.html.HTMLCollection getImages()
- getImages in interface org.w3c.dom.html.HTMLDocument
getLinks
public org.w3c.dom.html.HTMLCollection getLinks()
- getLinks in interface org.w3c.dom.html.HTMLDocument
getReferrer
public String getReferrer()
- getReferrer in interface org.w3c.dom.html.HTMLDocument
getTitle
public String getTitle()
- getTitle in interface org.w3c.dom.html.HTMLDocument
getURL
public String getURL()
- getURL in interface org.w3c.dom.html.HTMLDocument
open
public void open()
- open in interface org.w3c.dom.html.HTMLDocument
setBody
public void setBody(org.w3c.dom.html.HTMLElement newBody)
- setBody in interface org.w3c.dom.html.HTMLDocument
setCookie
public void setCookie(String cookie)
- setCookie in interface org.w3c.dom.html.HTMLDocument
setTitle
public void setTitle(String newTitle)
- setTitle in interface org.w3c.dom.html.HTMLDocument
write
public void write(String text)
- write in interface org.w3c.dom.html.HTMLDocument
writeln
public void writeln(String text)
- writeln in interface org.w3c.dom.html.HTMLDocument