|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.dom.NodeOverNodeInfo net.sf.saxon.dom.ElementOverNodeInfo
public class ElementOverNodeInfo
This class is an implementation of the DOM Element class that wraps a Saxon NodeInfo representation of an element node.
The class provides read-only access to the tree; methods that request updates all fail with an UnsupportedOperationException.
Note that contrary to the DOM specification, this implementation does not expose namespace declarations as attributes.
Field Summary |
---|
Fields inherited from class net.sf.saxon.dom.NodeOverNodeInfo |
---|
node |
Constructor Summary | |
---|---|
ElementOverNodeInfo()
|
Method Summary | |
---|---|
String |
getAttribute(String name)
Retrieves an attribute value by name. |
Attr |
getAttributeNode(String name)
Retrieves an attribute node by name. |
Attr |
getAttributeNodeNS(String namespaceURI,
String localName)
Retrieves an Attr node by local name and namespace URI. |
String |
getAttributeNS(String namespaceURI,
String localName)
Retrieves an attribute value by local name and namespace URI. |
NodeList |
getElementsByTagName(String name)
Returns a NodeList of all descendant Elements
with a given tag name, in document order. |
NodeList |
getElementsByTagNameNS(String namespaceURI,
String localName)
Returns a NodeList of all the descendant
Elements with a given local name and namespace URI in
document order. |
TypeInfo |
getSchemaTypeInfo()
Get the schema type information for this node. |
String |
getTagName()
The name of the element (DOM interface). |
boolean |
hasAttribute(String name)
Returns true when an attribute with a given name is
specified on this element or has a default value, false
otherwise. |
boolean |
hasAttributeNS(String namespaceURI,
String localName)
Returns true when an attribute with a given local name
and namespace URI is specified on this element or has a default value,
false otherwise. |
void |
removeAttribute(String oldAttr)
Removes the specified attribute. |
Attr |
removeAttributeNode(Attr oldAttr)
Removes the specified attribute node. |
void |
removeAttributeNS(String namespaceURI,
String localName)
Removes an attribute by local name and namespace URI. |
void |
setAttribute(String name,
String value)
Adds a new attribute. |
Attr |
setAttributeNode(Attr newAttr)
Adds a new attribute node. |
Attr |
setAttributeNodeNS(Attr newAttr)
Add a new attribute. |
void |
setAttributeNS(String namespaceURI,
String qualifiedName,
String value)
Adds a new attribute. |
void |
setIdAttribute(String name,
boolean isId)
Mark an attribute as an ID. |
void |
setIdAttributeNode(Attr idAttr,
boolean isId)
Mark an attribute as an ID. |
void |
setIdAttributeNS(String namespaceURI,
String localName,
boolean isId)
Mark an attribute as an ID. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, 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 |
Constructor Detail |
---|
public ElementOverNodeInfo()
Method Detail |
---|
public String getTagName()
getTagName
in interface Element
public NodeList getElementsByTagName(String name)
NodeList
of all descendant Elements
with a given tag name, in document order.
getElementsByTagName
in interface Element
name
- The name of the tag to match on. The special value "*"
matches all tags.
Element
nodes.public NodeList getElementsByTagNameNS(String namespaceURI, String localName) throws DOMException
NodeList
of all the descendant
Elements
with a given local name and namespace URI in
document order.
getElementsByTagNameNS
in interface Element
namespaceURI
- The namespace URI of the elements to match on. The
special value "*" matches all namespaces.localName
- The local name of the elements to match on. The
special value "*" matches all local names.
NodeList
object containing all the matched
Elements
.
DOMException
- NOT_SUPPORTED_ERR: May be raised if the implementation does not
support the feature "XML"
and the language exposed
through the Document does not support XML Namespaces (such as [HTML 4.01]).public String getAttribute(String name)
getAttribute
in interface Element
name
- The QName of the attribute to retrieve.
Attr
value as a string, or the empty string if
that attribute does not have a specified or default value.public Attr getAttributeNode(String name)
getAttributeNodeNS
method.
getAttributeNode
in interface Element
name
- The name (nodeName
) of the attribute to
retrieve.
Attr
node with the specified name (
nodeName
) or null
if there is no such
attribute.public Attr setAttributeNode(Attr newAttr) throws DOMException
setAttributeNode
in interface Element
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.public void removeAttribute(String oldAttr) throws DOMException
removeAttribute
in interface Element
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.public Attr removeAttributeNode(Attr oldAttr) throws DOMException
removeAttributeNode
in interface Element
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.public String getAttributeNS(String namespaceURI, String localName)
getAttributeNS
in interface Element
namespaceURI
- The namespace URI of the attribute to retrieve.localName
- The local name of the attribute to retrieve.
Attr
value as a string, or the empty string if
that attribute does not have a specified or default value.public void setAttribute(String name, String value) throws DOMException
setAttribute
in interface Element
name
- The name of the attribute to create or alter.value
- Value to set in string form.
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name is not an XML
name according to the XML version in use specified in the
Document.xmlVersion
attribute.
public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException
setAttributeNS
in interface Element
namespaceURI
- The namespace URI of the attribute to create or
alter.qualifiedName
- The qualified name of the attribute to create or
alter.value
- The value to set in string form.
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.public void removeAttributeNS(String namespaceURI, String localName) throws DOMException
removeAttributeNS
in interface Element
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.public Attr getAttributeNodeNS(String namespaceURI, String localName)
Attr
node by local name and namespace URI.
This implementation does not expose namespace nodes as attributes.
getAttributeNodeNS
in interface Element
namespaceURI
- The namespace URI of the attribute to retrieve.localName
- The local name of the attribute to retrieve.
Attr
node with the specified attribute local
name and namespace URI or null
if there is no such
attribute.public Attr setAttributeNodeNS(Attr newAttr) throws DOMException
setAttributeNodeNS
in interface Element
newAttr
- The Attr
node to add to the attribute list.
newAttr
attribute replaces an existing
attribute with the same local name and namespace URI , the
replaced Attr
node is returned, otherwise
null
is returned.
DOMException
- public boolean hasAttribute(String name)
true
when an attribute with a given name is
specified on this element or has a default value, false
otherwise.
This implementation does not expose namespace nodes as attributes.
hasAttribute
in interface Element
name
- The name of the attribute to look for.
true
if an attribute with the given name is
specified on this element or has a default value, false
otherwise.public boolean hasAttributeNS(String namespaceURI, String localName)
true
when an attribute with a given local name
and namespace URI is specified on this element or has a default value,
false
otherwise.
This implementation does not expose namespace nodes as attributes.
hasAttributeNS
in interface Element
namespaceURI
- The namespace URI of the attribute to look for.localName
- The local name of the attribute to look for.
true
if an attribute with the given local name and
namespace URI is specified or has a default value on this element,
false
otherwise.public void setIdAttribute(String name, boolean isId) throws DOMException
setIdAttribute
in interface Element
DOMException
public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException
setIdAttributeNS
in interface Element
DOMException
public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException
setIdAttributeNode
in interface Element
DOMException
public TypeInfo getSchemaTypeInfo()
getSchemaTypeInfo
in interface Element
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |