|
|||||||||
| Home >> All >> gnu >> xml >> dom >> [ html2 overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
gnu.xml.dom.html2
Class DomHTMLDocument

java.lang.Objectgnu.xml.dom.DomNode
gnu.xml.dom.DomDocument
gnu.xml.dom.html2.DomHTMLDocument
- All Implemented Interfaces:
- java.lang.Cloneable, java.lang.Comparable, org.w3c.dom.Document, org.w3c.dom.events.DocumentEvent, org.w3c.dom.traversal.DocumentTraversal, org.w3c.dom.events.EventTarget, org.w3c.dom.html2.HTMLDocument, org.w3c.dom.Node, org.w3c.dom.NodeList, org.w3c.dom.xpath.XPathEvaluator
- public class DomHTMLDocument
- extends gnu.xml.dom.DomDocument
- implements org.w3c.dom.html2.HTMLDocument
- extends gnu.xml.dom.DomDocument
An HTML document. This is the factory object used to create HTML elements.
| Nested Class Summary |
| Nested classes inherited from class gnu.xml.dom.DomNode |
|
| Field Summary | |
private static java.util.Map |
ELEMENT_CLASSES
|
private static java.lang.Class[] |
ELEMENT_PT
|
private static java.util.Set |
HTML_NS_URIS
|
| Fields inherited from class gnu.xml.dom.DomDocument |
|
| Fields inherited from class gnu.xml.dom.DomNode |
|
| Constructor Summary | |
DomHTMLDocument()
Convenience constructor. |
|
DomHTMLDocument(DomHTMLImpl impl)
Constructor. |
|
| Method Summary | |
void |
close()
Closes a document stream opened by open() and forces
rendering. |
org.w3c.dom.Element |
createElement(java.lang.String tagName)
Creates an element of the type specified. |
org.w3c.dom.Element |
createElementNS(java.lang.String uri,
java.lang.String qName)
Creates an element of the given qualified name and namespace URI. |
org.w3c.dom.html2.HTMLCollection |
getAnchors()
A collection of all the anchor ( A) elements in a document
with a value for the name attribute. |
org.w3c.dom.html2.HTMLCollection |
getApplets()
A collection of all the OBJECT elements that include
applets and APPLET (deprecated) elements in a document. |
org.w3c.dom.html2.HTMLElement |
getBody()
The element that contains the content for the document. |
private org.w3c.dom.Node |
getChildNodeByName(org.w3c.dom.Node parent,
java.lang.String name)
|
java.lang.String |
getCookie()
This mutable string attribute denotes persistent state information that (1) is associated with the current frame or document and (2) is composed of information described by the cookies
non-terminal of [IETF RFC 2965], Section 4.2.2. |
java.lang.String |
getDomain()
The domain name of the server that served the document, or null if the server cannot be identified by a domain
name. |
org.w3c.dom.NodeList |
getElementsByName(java.lang.String name)
With [HTML 4.01] documents, this method returns the (possibly empty) collection of elements whose name value is given by
elementName. |
org.w3c.dom.html2.HTMLCollection |
getForms()
A collection of all the forms of a document. |
org.w3c.dom.html2.HTMLCollection |
getImages()
A collection of all the IMG elements in a document. |
org.w3c.dom.html2.HTMLCollection |
getLinks()
A collection of all AREA elements and anchor (
A) elements in a document with a value for the
href attribute. |
java.lang.String |
getReferrer()
Returns the URI [IETF RFC 2396] of the page that linked to this page. |
java.lang.String |
getTitle()
The title of a document as specified by the TITLE element
in the head of the document. |
java.lang.String |
getURL()
The absolute URI [IETF RFC 2396] of the document. |
void |
open()
Open a document stream for writing. |
void |
setBody(org.w3c.dom.html2.HTMLElement body)
The element that contains the content for the document. |
void |
setCookie(java.lang.String cookie)
This mutable string attribute denotes persistent state information that (1) is associated with the current frame or document and (2) is composed of information described by the cookies
non-terminal of [IETF RFC 2965], Section 4.2.2. |
void |
setTitle(java.lang.String title)
The title of a document as specified by the TITLE element
in the head of the document. |
void |
write(java.lang.String text)
Write a string of text to a document stream opened by open(). |
void |
writeln(java.lang.String text)
Write a string of text followed by a newline character to a document stream opened by open(). |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.w3c.dom.Node |
appendChild, cloneNode, 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 |
| Field Detail |
ELEMENT_PT
private static final java.lang.Class[] ELEMENT_PT
ELEMENT_CLASSES
private static java.util.Map ELEMENT_CLASSES
HTML_NS_URIS
private static java.util.Set HTML_NS_URIS
| Constructor Detail |
DomHTMLDocument
public DomHTMLDocument()
- Convenience constructor.
DomHTMLDocument
public DomHTMLDocument(DomHTMLImpl impl)
- Constructor.
This is called by the DOMImplementation.
| Method Detail |
getChildNodeByName
private org.w3c.dom.Node getChildNodeByName(org.w3c.dom.Node parent, java.lang.String name)
getTitle
public java.lang.String getTitle()
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - The title of a document as specified by the
TITLEelement in the head of the document.- Specified by:
getTitlein interfaceorg.w3c.dom.html2.HTMLDocument
setTitle
public void setTitle(java.lang.String title)
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - The title of a document as specified by the
TITLEelement in the head of the document.- Specified by:
setTitlein interfaceorg.w3c.dom.html2.HTMLDocument
getReferrer
public java.lang.String getReferrer()
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - Returns the URI [IETF RFC 2396] of the page that linked to this page. The value is an
empty string if the user navigated to the page directly (not through
a link, but, for example, via a bookmark).
- Specified by:
getReferrerin interfaceorg.w3c.dom.html2.HTMLDocument
getDomain
public java.lang.String getDomain()
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - The domain name of the server that served the document, or
nullif the server cannot be identified by a domain name.- Specified by:
getDomainin interfaceorg.w3c.dom.html2.HTMLDocument
getURL
public java.lang.String getURL()
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - The absolute URI [IETF RFC 2396] of the document.
- Specified by:
getURLin interfaceorg.w3c.dom.html2.HTMLDocument
getBody
public org.w3c.dom.html2.HTMLElement getBody()
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - The element that contains the content for the document. In documents
with
BODYcontents, returns theBODYelement. In frameset documents, this returns the outermostFRAMESETelement.- Specified by:
getBodyin interfaceorg.w3c.dom.html2.HTMLDocument
setBody
public void setBody(org.w3c.dom.html2.HTMLElement body)
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - The element that contains the content for the document. In documents
with
BODYcontents, returns theBODYelement. In frameset documents, this returns the outermostFRAMESETelement.- Specified by:
setBodyin interfaceorg.w3c.dom.html2.HTMLDocument
getImages
public org.w3c.dom.html2.HTMLCollection getImages()
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - A collection of all the
IMGelements in a document. The behavior is limited toIMGelements for backwards compatibility. As suggested by [HTML 4.01], to include images, authors may use theOBJECTelement or theIMGelement. Therefore, it is recommended not to use this attribute to find the images in the document butgetElementsByTagNamewith HTML 4.01 orgetElementsByTagNameNSwith XHTML 1.0.- Specified by:
getImagesin interfaceorg.w3c.dom.html2.HTMLDocument
getApplets
public org.w3c.dom.html2.HTMLCollection getApplets()
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - A collection of all the
OBJECTelements that include applets andAPPLET(deprecated) elements in a document.- Specified by:
getAppletsin interfaceorg.w3c.dom.html2.HTMLDocument
getLinks
public org.w3c.dom.html2.HTMLCollection getLinks()
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - A collection of all
AREAelements and anchor (A) elements in a document with a value for thehrefattribute.- Specified by:
getLinksin interfaceorg.w3c.dom.html2.HTMLDocument
getForms
public org.w3c.dom.html2.HTMLCollection getForms()
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - A collection of all the forms of a document.
- Specified by:
getFormsin interfaceorg.w3c.dom.html2.HTMLDocument
getAnchors
public org.w3c.dom.html2.HTMLCollection getAnchors()
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - A collection of all the anchor (
A) elements in a document with a value for thenameattribute. For reasons of backward compatibility, the returned set of anchors only contains those anchors created with thenameattribute, not those created with theidattribute. Note that in [XHTML 1.0], thenameattribute (see section 4.10) has no semantics and is only present for legacy user agents: theidattribute is used instead. Users should prefer the iterator mechanisms provided by [DOM Level 2 Traversal] instead.- Specified by:
getAnchorsin interfaceorg.w3c.dom.html2.HTMLDocument
getCookie
public java.lang.String getCookie()
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - This mutable string attribute denotes persistent state information
that (1) is associated with the current frame or document and (2) is
composed of information described by the
cookiesnon-terminal of [IETF RFC 2965], Section 4.2.2.
If no persistent state information is available for the current frame or document document, then this property's value is an empty string.
When this attribute is read, all cookies are returned as a single string, with each cookie's name-value pair concatenated into a list of name-value pairs, each list item being separated by a ';' (semicolon).
When this attribute is set, the value it is set to should be a string that adheres to thecookienon-terminal of [IETF RFC 2965]; that is, it should be a single name-value pair followed by zero or more cookie attribute values. If no domain attribute is specified, then the domain attribute for the new value defaults to the host portion of an absolute URI [IETF RFC 2396] of the current frame or document. If no path attribute is specified, then the path attribute for the new value defaults to the absolute path portion of the URI [IETF RFC 2396] of the current frame or document. If no max-age attribute is specified, then the max-age attribute for the new value defaults to a user agent defined value. If a cookie with the specified name is already associated with the current frame or document, then the new value as well as the new attributes replace the old value and attributes. If a max-age attribute of 0 is specified for the new value, then any existing cookies of the specified name are removed from the cookie storage. See [IETF RFC 2965] for the semantics of persistent state item attribute value pairs. The precise nature of a user agent session is not defined by this specification.- Specified by:
getCookiein interfaceorg.w3c.dom.html2.HTMLDocument
setCookie
public void setCookie(java.lang.String cookie)
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - This mutable string attribute denotes persistent state information
that (1) is associated with the current frame or document and (2) is
composed of information described by the
cookiesnon-terminal of [IETF RFC 2965], Section 4.2.2.
If no persistent state information is available for the current frame or document document, then this property's value is an empty string.
When this attribute is read, all cookies are returned as a single string, with each cookie's name-value pair concatenated into a list of name-value pairs, each list item being separated by a ';' (semicolon).
When this attribute is set, the value it is set to should be a string that adheres to thecookienon-terminal of [IETF RFC 2965]; that is, it should be a single name-value pair followed by zero or more cookie attribute values. If no domain attribute is specified, then the domain attribute for the new value defaults to the host portion of an absolute URI [IETF RFC 2396] of the current frame or document. If no path attribute is specified, then the path attribute for the new value defaults to the absolute path portion of the URI [IETF RFC 2396] of the current frame or document. If no max-age attribute is specified, then the max-age attribute for the new value defaults to a user agent defined value. If a cookie with the specified name is already associated with the current frame or document, then the new value as well as the new attributes replace the old value and attributes. If a max-age attribute of 0 is specified for the new value, then any existing cookies of the specified name are removed from the cookie storage. See [IETF RFC 2965] for the semantics of persistent state item attribute value pairs. The precise nature of a user agent session is not defined by this specification.- Specified by:
setCookiein interfaceorg.w3c.dom.html2.HTMLDocument
open
public void open()
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - Open a document stream for writing. If a document exists in the target,
this method clears it. This method and the ones following allow a
user to add to or replace the structure model of a document using
strings of unparsed HTML. At the time of writing alternate methods
for providing similar functionality for both HTML and XML documents
were being considered (see [DOM Level 3 Load and Save]).
- Specified by:
openin interfaceorg.w3c.dom.html2.HTMLDocument
close
public void close()
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - Closes a document stream opened by
open()and forces rendering.- Specified by:
closein interfaceorg.w3c.dom.html2.HTMLDocument
write
public void write(java.lang.String text)
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - Write a string of text to a document stream opened by
open(). Note that the function will produce a document which is not necessarily driven by a DTD and therefore might be produce an invalid result in the context of the document.- Specified by:
writein interfaceorg.w3c.dom.html2.HTMLDocument
writeln
public void writeln(java.lang.String text)
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - Write a string of text followed by a newline character to a document
stream opened by
open(). Note that the function will produce a document which is not necessarily driven by a DTD and therefore might be produce an invalid result in the context of the document- Specified by:
writelnin interfaceorg.w3c.dom.html2.HTMLDocument
getElementsByName
public org.w3c.dom.NodeList getElementsByName(java.lang.String name)
- Description copied from interface:
org.w3c.dom.html2.HTMLDocument - With [HTML 4.01] documents, this method returns the (possibly empty) collection
of elements whose
namevalue is given byelementName. In [XHTML 1.0] documents, this methods only return the (possibly empty) collection of form controls with matching name. This method is case sensitive.- Specified by:
getElementsByNamein interfaceorg.w3c.dom.html2.HTMLDocument
createElement
public org.w3c.dom.Element createElement(java.lang.String tagName)
- Description copied from interface:
org.w3c.dom.Document - Creates an element of the type specified. Note that the instance
returned implements the
Elementinterface, so attributes can be specified directly on the returned object.
In addition, if there are known attributes with default values,Attrnodes representing them are automatically created and attached to the element.
To create an element with a qualified name and namespace URI, use thecreateElementNSmethod.- Specified by:
createElementin interfaceorg.w3c.dom.Document
createElementNS
public org.w3c.dom.Element createElementNS(java.lang.String uri, java.lang.String qName)
- Description copied from interface:
org.w3c.dom.Document - Creates an element of the given qualified name and namespace URI.
Per [XML Namespaces] , applications must use the valuenullas the namespaceURI parameter for methods if they wish to have no namespace.- Specified by:
createElementNSin interfaceorg.w3c.dom.Document
|
|||||||||
| Home >> All >> gnu >> xml >> dom >> [ html2 overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC