net.sf.saxon.dom

Class AttrOverNodeInfo

Implemented Interfaces:
Attr, Node

public class AttrOverNodeInfo
extends NodeOverNodeInfo
implements Attr

This class is an implementation of the DOM Attr class that wraps a Saxon NodeInfo representation of an attribute or namespace node.

Field Summary

Fields inherited from class net.sf.saxon.dom.NodeOverNodeInfo

node

Method Summary

NodeList
getChildNodes()
Return a NodeList that contains all children of this node.
Node
getFirstChild()
Get first child
Node
getLastChild()
Get last child
String
getName()
Get the name of an attribute node (the lexical QName) (DOM method)
Element
getOwnerElement()
The Element node this attribute is attached to or null if this attribute is not in use.
TypeInfo
getSchemaTypeInfo()
Get the schema type information for this node.
boolean
getSpecified()
If this attribute was explicitly given a value in the original document, this is true ; otherwise, it is false.
String
getValue()
Return the character value of an attribute node (DOM method)
boolean
hasChildNodes()
Determine whether the node has any children.
boolean
isId()
Determine whether this (attribute) node is an ID.
void
setValue(String value)
Set the value of an attribute node.

Methods inherited from class net.sf.saxon.dom.NodeOverNodeInfo

appendChild, cloneNode, compareDocumentPosition, disallowUpdate, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUnderlyingNodeInfo, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData, wrap

Method Details

getChildNodes

public NodeList getChildNodes()
Return a NodeList that contains all children of this node. If there are no children, this is a NodeList containing no nodes.
Overrides:
getChildNodes in interface NodeOverNodeInfo

getFirstChild

public Node getFirstChild()
Get first child
Overrides:
getFirstChild in interface NodeOverNodeInfo
Returns:
the first child node of this node. In this model an attribute node always has a single text node as its child.

getLastChild

public Node getLastChild()
Get last child
Overrides:
getLastChild in interface NodeOverNodeInfo
Returns:
last child of this node, or null if it has no children

getName

public String getName()
Get the name of an attribute node (the lexical QName) (DOM method)

getOwnerElement

public Element getOwnerElement()
The Element node this attribute is attached to or null if this attribute is not in use.
Since:
DOM Level 2

getSchemaTypeInfo

public TypeInfo getSchemaTypeInfo()
Get the schema type information for this node. Returns null for an untyped node.

getSpecified

public boolean getSpecified()
If this attribute was explicitly given a value in the original document, this is true ; otherwise, it is false. (DOM method)
Returns:
Always true in this implementation.

getValue

public String getValue()
Return the character value of an attribute node (DOM method)
Returns:
the attribute value

hasChildNodes

public boolean hasChildNodes()
Determine whether the node has any children.
Overrides:
hasChildNodes in interface NodeOverNodeInfo
Returns:
true: a DOM Attribute has a text node as a child.

isId

public boolean isId()
Determine whether this (attribute) node is an ID. This method is introduced in DOM Level 3.

setValue

public void setValue(String value)
            throws DOMException
Set the value of an attribute node. (DOM method). Always fails (because tree is readonly)