org.exolab.adaptx.xslt.dom

Class Element

public class Element extends ParentNode

A representation of an Element node

Version: $Revision: 3633 $ $Date: 2003-03-01 02:38:44 -0500 (Sat, 01 Mar 2003) $

Author: Keith Visco

Constructor Summary
Element(String namespace, String localName)
Creates a new Element
Method Summary
voidaddAttribute(Attribute attr)
Adds the given Attribute to this Element
voidaddNamespace(Namespace namespace)
Adds the given Attribute to this Element
StringgetAttribute(String uri, String localName)
Returns the value of the named attribute, or null if the node has no such attribute.
XPathNodegetFirstAttribute()
Returns the first in a list of attribute nodes, or null if the node has no attributes.
XPathNodegetFirstNamespace()
Returns the first in a list of namespace nodes, or null if the node has no namespaces.
StringgetNamespacePrefix(String uri)
Returns the namespace prefix associated with this namespace URI, as defined in the context of this node.
StringgetNamespaceURI(String prefix)
Returns the namespace URI associated with this namespace prefix, as defined in the context of this node.
intgetNodeType()
Returns the type of this node.

Constructor Detail

Element

public Element(String namespace, String localName)
Creates a new Element

Parameters: namespace the namespace URI for this node. [May be null] localName the local-name of this node. [Cannot be null]

Method Detail

addAttribute

public void addAttribute(Attribute attr)
Adds the given Attribute to this Element

Parameters: attr the Attribute to add

addNamespace

public void addNamespace(Namespace namespace)
Adds the given Attribute to this Element

Parameters: attr the Attribute to add

getAttribute

public String getAttribute(String uri, String localName)
Returns the value of the named attribute, or null if the node has no such attribute. If the argument uri is null, the node's namespace URI will be used. This method is valid only for the element node.

Parameters: uri The attribute's namespace URI, or null localName The attribute's local name

Returns: The attribute's value, or null if no such attribute exists

getFirstAttribute

public XPathNode getFirstAttribute()
Returns the first in a list of attribute nodes, or null if the node has no attributes. This method is valid only for the element node.

Returns: The first in a list of attribute nodes, or null

getFirstNamespace

public XPathNode getFirstNamespace()
Returns the first in a list of namespace nodes, or null if the node has no namespaces. This method is valid only for the element node.

Returns: The first in a list of namespace nodes, or null

getNamespacePrefix

public String getNamespacePrefix(String uri)
Returns the namespace prefix associated with this namespace URI, as defined in the context of this node. Returns null if no prefix is defined for this namespace URI. Returns an empty string if the default prefix is associated with this namespace URI. This method is valid only for element nodes.

Parameters: uri The namespace URI

Returns: The namespace prefix, or null

getNamespaceURI

public String getNamespaceURI(String prefix)
Returns the namespace URI associated with this namespace prefix, as defined in the context of this node. Returns null if the prefix is undefined. Returns empty if the prefix is defined and associated with no namespace. This method is valid only for element nodes.

Parameters: prefix The namespace prefix

Returns: The namespace URI, or null

getNodeType

public int getNodeType()
Returns the type of this node.

Returns: The type of this node