|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xml.utils.UnImplNode | +--org.apache.xalan.stree.Child | +--org.apache.xalan.stree.Parent | +--org.apache.xalan.stree.ElementImpl
**For internal use only** This class represents an element in an HTML or XML document. Elements may have attributes associated with them as well as children nodes.
Method Summary | |
Attr |
createAttribute(java.lang.String name)
Create an attribute node. |
Attr |
createAttributeNS(java.lang.String namespaceURI,
java.lang.String qualifiedName)
Create an attribute node with a namespace . |
int |
getAttrCount()
Return the number of attributes in the list. |
java.lang.String |
getAttribute(java.lang.String name)
Look up an attribute's value by name. |
NamedNodeMap |
getAttributes()
Get attributes of this node. |
AttrImpl |
getChildAttribute(int i)
Get the nth attribute child. |
int |
getChildCount()
Get the number of children this node currently contains. |
int |
getIndex(java.lang.String rawName)
Look up the index of an attribute by raw XML 1.0 name. |
int |
getIndex(java.lang.String uri,
java.lang.String localPart)
Look up the index of an attribute by Namespace name. |
int |
getLength()
The number of nodes (attributes) in this map. |
java.lang.String |
getLocalName()
Returns the local part of the qualified name of this node. |
java.lang.String |
getLocalName(int index)
Look up an attribute's local name by index. |
Node |
getNamedItem(java.lang.String name)
Get the child attribute with the specified attribute name |
Node |
getNamedItemNS(java.lang.String namespaceURI,
java.lang.String localName)
Retrieves a node specified by local name and namespace URI. |
java.lang.String |
getNodeName()
Returns the node name. |
short |
getNodeType()
A short integer indicating what type of node this is. |
java.lang.String |
getQName(int index)
Look up an attribute's raw XML 1.0 name by index. |
java.lang.String |
getTagName()
Returns the tag name of this node. |
java.lang.String |
getType(int index)
Look up an attribute's type by index. |
java.lang.String |
getType(java.lang.String rawName)
Look up an attribute's type by raw XML 1.0 name. |
java.lang.String |
getType(java.lang.String uri,
java.lang.String localName)
Look up an attribute's type by Namespace name. |
java.lang.String |
getURI(int index)
Look up an attribute's Namespace URI by index. |
java.lang.String |
getValue(int index)
Look up an attribute's value by index. |
java.lang.String |
getValue(java.lang.String rawName)
Look up an attribute's value by raw XML 1.0 name. |
java.lang.String |
getValue(java.lang.String uri,
java.lang.String localName)
Look up an attribute's value by Namespace name. |
Node |
item(int index)
Returns the index th item in the map. |
Node |
removeItem(int index)
Remove the attribute at the specified index from the attribute list |
Node |
removeNamedItem(java.lang.String name)
Removes a node specified by name. |
Node |
removeNamedItemNS(java.lang.String namespaceURI,
java.lang.String localName)
Removes a node specified by local name and namespace URI. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Set attributes of this node. |
void |
setAttributeNS(java.lang.String namespaceURI,
java.lang.String qualifiedName,
java.lang.String value)
Set attributes of this node. |
void |
setAttributes(Attributes atts)
Set a list of attributes of this node. |
void |
setIDAttribute(java.lang.String value)
Set the ID string to element association for this node. |
Node |
setNamedItem(Node arg)
Adds a node using its nodeName attribute. |
Node |
setNamedItemNS(Node arg)
Adds a node using its namespaceURI and
localName . |
Methods inherited from class org.apache.xalan.stree.Parent |
appendChild,
dispatchCharactersEvent,
getChild,
getChildUID,
getFirstChild,
getLastChild,
hasChildNodes,
isComplete,
setComplete |
Methods inherited from class org.apache.xalan.stree.Child |
getLevel,
getNamespaceURI,
getNextSibling,
getOwnerDocument,
getParentNode,
getPrefix,
getPreviousSibling,
getUid,
isNamespaceNode,
isSupported,
setLevel |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public short getNodeType()
public java.lang.String getNodeName()
public java.lang.String getLocalName()
createElement
from the Document
interface,
it is null
.public java.lang.String getTagName()
createElement
from the Document
interface,
it is null
.public AttrImpl getChildAttribute(int i) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.NullPointerException
i
- the index of the child.public int getChildCount()
public NamedNodeMap getAttributes()
createElement
from the Document
interface,
it is null
.public void setAttribute(java.lang.String name, java.lang.String value) throws DOMException
createElement
from the Document
interface,
it is null
.name
- attribute namevalue
- attribute valuepublic void setAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String value) throws DOMException
createElement
from the Document
interface,
it is null
.namespaceURI
- Attribute name spacequalifiedName
- Attribute qualified namevalue
- Attribute valuepublic void setAttributes(Attributes atts) throws DOMException
createElement
from the Document
interface,
it is null
.atts
- List of attributes to set for this nodepublic void setIDAttribute(java.lang.String value)
value
- The ID string, should not be null.public Attr createAttribute(java.lang.String name) throws DOMException
name
- Attribute name to createpublic Attr createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName) throws DOMException
namespaceURI
- name space of the attribute to createqualifiedName
- qualified name of the attribute to createpublic int getAttrCount()
public java.lang.String getURI(int index)
index
- The attribute index (zero-based).public java.lang.String getLocalName(int index)
index
- The attribute index (zero-based).public java.lang.String getQName(int index)
index
- The attribute index (zero-based).public java.lang.String getType(int index)
index
- The attribute index (zero-based).public java.lang.String getValue(int index)
index
- The attribute index (zero-based).public java.lang.String getAttribute(java.lang.String name)
name
- The attribute name to look uppublic int getIndex(java.lang.String uri, java.lang.String localPart)
uri
- The Namespace URI, or the empty string if
the name has no Namespace URI.localPart
- The attribute's local name.public int getIndex(java.lang.String rawName)
rawName
- The raw (prefixed) name.public java.lang.String getType(java.lang.String uri, java.lang.String localName)
uri
- The Namespace URI, or the empty String if the
name has no Namespace URI.localName
- The local name of the attribute.public java.lang.String getType(java.lang.String rawName)
rawName
- The raw XML 1.0 name.public java.lang.String getValue(java.lang.String uri, java.lang.String localName)
uri
- The Namespace URI, or the empty String if the
name has no Namespace URI.localName
- The local name of the attribute.public java.lang.String getValue(java.lang.String rawName)
rawName
- The raw XML 1.0 name.public Node getNamedItem(java.lang.String name)
name
- Attribute name to look uppublic Node setNamedItem(Node arg) throws DOMException
nodeName
attribute. If a node with
that name is already present in this map, it is replaced by the new
one.
nodeName
attribute is used to derive the name
which the node must be stored under, multiple nodes of certain types
(those that have a "special" string value) cannot be stored as the
names would clash. This is seen as preferable to allowing nodes to be
aliased.arg
- A node to store in this map. The node will later be
accessible using the value of its nodeName
attribute.Node
replaces an existing node the
replaced Node
is returned, otherwise null
is returned.arg
was created from a
different document than the one that created this map.
arg
is an
Attr
that is already an attribute of another
Element
object. The DOM user must explicitly clone
Attr
nodes to re-use them in other elements.public Node removeNamedItem(java.lang.String name) throws DOMException
Node
interface. If so, an attribute immediately appears
containing the default value as well as the corresponding namespace
URI, local name, and prefix when applicable.name
- The nodeName
of the node to remove.name
in this map.
public Node removeItem(int index) throws DOMException
index
- Position of attribute to remove in attribute listpublic int getLength()
0
to length-1
inclusive.public Node item(int index)
index
th item in the map. If
index
is greater than or equal to the number of nodes in
this map, this returns null
.index
- Index into this map.index
th position in the map, or
null
if that is not a valid index.public Node getNamedItemNS(java.lang.String namespaceURI, java.lang.String localName)
namespaceURI
- The namespace URI of the node to retrieve.localName
- The local name of the node to retrieve.Node
(of any type) with the specified local
name and namespace URI, or null
if they do not identify
any node in this map.public Node setNamedItemNS(Node arg) throws DOMException
namespaceURI
and
localName
. If a node with that namespace URI and that
local name is already present in this map, it is replaced by the new
one.
arg
- A node to store in this map. The node will later be
accessible using the value of its namespaceURI
and
localName
attributes.Node
replaces an existing node the
replaced Node
is returned, otherwise null
is returned.arg
was created from a
different document than the one that created this map.
arg
is an
Attr
that is already an attribute of another
Element
object. The DOM user must explicitly clone
Attr
nodes to re-use them in other elements.public Node removeNamedItemNS(java.lang.String namespaceURI, java.lang.String localName) throws DOMException
Node
interface. If so, an attribute
immediately appears containing the default value as well as the
corresponding namespace URI, local name, and prefix when applicable.
namespaceURI
- The namespace URI of the node to remove.localName
- The local name of the node to remove.namespaceURI
and localName
in this map.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |