xml.dom.xhtml
Class XhtmlDomElement

java.lang.Object
  |
  +--xml.dom.DomNode
        |
        +--xml.dom.DomNsNode
              |
              +--xml.dom.DomElement
                    |
                    +--xml.dom.xhtml.XhtmlDomElement
All Implemented Interfaces:
java.lang.Cloneable, DocumentEvent, Element, EventTarget, HTMLElement, Node, NodeList

public class XhtmlDomElement
extends DomElement
implements HTMLElement

XHTML subclass of "DomElement", implementing HTMLElement and knowing about its namespace and the legal element names in that namespace.

In the HTML DOM, the following HTML elements offer no further functionality than is offered by this class (although they have non-XHTML rules affecting case normalization in names): HEAD, SUB, SUP, SPAN, BDO, TT, I, EM, B, U, S, STRIKE, BIG, SMALL, EM, STRONG, CODE, DFN, SAMP, KBD, VAR, CITE, ACRONYM, ABBR, DD, DT, NOFRAMES, NOSCRIPT, ADDRESS, CENTER. Ninety or so other elements exist, and are defined to use subtypes of the HTMLElement interface.

DOM Level 2 defines an HTMLElementCSS interface to support access to the CSS style information for an element; this is not supported by this implementation, since that is part of the "CSS" stylesheet feature.

NOTE: At this writing, constraints on legal XHTML attribute names are not enforced.

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

Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
protected XhtmlDomElement(Document owner, java.lang.String name)
          Constructs an XHTML Element node associated with the specified document.
 
Method Summary
 java.lang.String getClassName()
          Returns the name of the CSS "class" attribute of this element.
 java.lang.String getDir()
          Returns the "dir" attribute of this element; searches parents for such a value, as appropriate.
 java.lang.String getId()
          Returns the "id" attribute of this element, or null.
 java.lang.String getLang()
          Returns the "xml:lang" attribute of this element, or the value of the "lang" attribute if there is none; searches parents for such values, as appropriate.
 java.lang.String getTitle()
          Returns the "title" attribute of this element, or null.
 void setClassName(java.lang.String className)
          Assigns the CSS "class" attribute of this element.
 void setDir(java.lang.String dir)
          Assigns the "dir" attribute of this element.
 void setId(java.lang.String id)
          Assigns the "id" attribute of this element.
 void setLang(java.lang.String lang)
          Sets the "lang" and "xml:lang" attributes of this element.
 void setTitle(java.lang.String title)
          Assigns the "title" attribute of this element.
 
Methods inherited from class xml.dom.DomElement
clone, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getTagName, hasAttribute, hasAttributeNS, hasAttributes, makeReadonly, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS
 
Methods inherited from class xml.dom.DomNsNode
getLocalName, getNamespaceURI, getNodeName, getPrefix, setPrefix
 
Methods inherited from class xml.dom.DomNode
addEventListener, appendChild, cloneNode, createEvent, dispatchEvent, getChildNodes, getElementsByTagName, getElementsByTagNameNS, getFirstChild, getLastChild, getLength, getNextSibling, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, hasChildNodes, insertBefore, isReadonly, isSupported, item, nameAndTypeEquals, normalize, removeChild, removeEventListener, replaceChild, setNodeValue, trimToSize
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Constructor Detail

XhtmlDomElement

protected XhtmlDomElement(Document owner,
                          java.lang.String name)
Constructs an XHTML Element node associated with the specified document.

This constructor should only be invoked by a Document as part of its createElement functionality, or through a subclass which is similarly used by the Document class in a "Sub-DOM" style layer.

Parameters:
owner - The document with which this element is associated
name - Name of this element, which may include a prefix
Throws:
DOMException - NOT_SUPPORTED_ERR if the local part of the name is not in the XHTML 1.0 element vocabulary
Method Detail

getId

public final java.lang.String getId()
Returns the "id" attribute of this element, or null.
Specified by:
getId in interface HTMLElement

setId

public final void setId(java.lang.String id)
Assigns the "id" attribute of this element. If the string is not an XML name, a DOM exception is reported. If the element is an "a" element, or another of the HTML elements for which a "name" attribute is defined, its "name" is also set to ensure that these deprecated attributes remain consistent.
Specified by:
setId in interface HTMLElement

getTitle

public final java.lang.String getTitle()
Returns the "title" attribute of this element, or null.
Specified by:
getTitle in interface HTMLElement

setTitle

public final void setTitle(java.lang.String title)
Assigns the "title" attribute of this element.
Specified by:
setTitle in interface HTMLElement

getLang

public java.lang.String getLang()
Returns the "xml:lang" attribute of this element, or the value of the "lang" attribute if there is none; searches parents for such values, as appropriate.
Specified by:
getLang in interface HTMLElement

setLang

public final void setLang(java.lang.String lang)
Sets the "lang" and "xml:lang" attributes of this element. These values must be in the standard IETF form for such langauge identifiers; the value is not currently checked for errors.
Specified by:
setLang in interface HTMLElement

getDir

public java.lang.String getDir()
Returns the "dir" attribute of this element; searches parents for such a value, as appropriate.
Specified by:
getDir in interface HTMLElement

setDir

public void setDir(java.lang.String dir)
Assigns the "dir" attribute of this element.
Specified by:
setDir in interface HTMLElement

getClassName

public final java.lang.String getClassName()
Returns the name of the CSS "class" attribute of this element.
Specified by:
getClassName in interface HTMLElement

setClassName

public final void setClassName(java.lang.String className)
Assigns the CSS "class" attribute of this element.
Specified by:
setClassName in interface HTMLElement

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