org.castor.xmlctf.xmldiff.xml.nodes
Class Element
A representation of an Element XML node.
$Revision: 0000 $ $Date: 2007-01-11 00:00:00 -0600 (Thu, 11 Jan 2007) $
Element(String namespace, String localName) - Creates a new Element.
|
void | addAttribute(Attribute attr) - Adds the given Attribute to this Element.
|
void | addNamespace(Namespace namespace) - Adds the given Namespace to this Element.
|
String | getAttribute(String uri, String localName) - Returns the value of the named attribute, or null if the node has no such
attribute.
|
Iterator | getAttributeIterator() - Returns an Iterator over the List of Attributes.
|
Location | getLocation() - Returns the location of this Element in the document.
|
String | getNamespacePrefix(String uri) - Returns the namespace prefix associated with this namespace URI, as
defined in the context of this node.
|
String | getNamespaceURI(String prefix) - Returns the namespace URI associated with this namespace prefix, as
defined in the context of this node.
|
void | setLocation(Location location) - Sets the location of this Element in the document.
|
getLocalName , getNamespaceURI , getNamespaceURI , getNodeLocation , getNodeType , getParentNode , getRootNode , getStringValue , getXPath , setNamespace , setParent |
Element
public Element(String namespace,
String localName)
Creates a new Element.
namespace
- the namespace URI for this node. (May be null.)localName
- the localname of this node. (Cannot be null.)
addAttribute
public void addAttribute(Attribute attr)
Adds the given Attribute to this Element.
attr
- the Attribute to add
addNamespace
public void addNamespace(Namespace namespace)
Adds the given Namespace to this Element.
namespace
- the Namespace 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.
uri
- The attribute's namespace URI, or nulllocalName
- The attribute's local name
- The attribute's value, or null if no such attribute exists
getAttributeIterator
public Iterator getAttributeIterator()
Returns an Iterator over the List of Attributes.
- an Iterator over the List of Attributes.
getLocation
public Location getLocation()
Returns the location of this Element in the document.
- the location of this Element in the document.
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.
- 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 an empty String if the prefix is defined and
associated with no namespace.
- getNamespaceURI in interface XMLNode
prefix
- The namespace prefix
- The namespace URI, or null.
setLocation
public void setLocation(Location location)
Sets the location of this Element in the document.
location
- the location of this Element in the document.
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com