public class Element extends ParentNode
Constructor and Description |
---|
Element(String namespace,
String localName)
Creates a new Element.
|
Modifier and Type | Method and Description |
---|---|
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.
|
addChild, getChildIterator, getStringValue, hasChildNodes
getLocalName, getNamespaceURI, getNodeLocation, getNodeType, getParentNode, getRootNode, getXPath, setNamespace
public Iterator getAttributeIterator()
public String getAttribute(String uri, String localName)
uri
- The attribute's namespace URI, or nulllocalName
- The attribute's local namepublic String getNamespaceURI(String prefix)
getNamespaceURI
in class XMLNode
prefix
- The namespace prefixpublic String getNamespacePrefix(String uri)
uri
- The namespace URIpublic void addAttribute(Attribute attr)
attr
- the Attribute to addpublic void addNamespace(Namespace namespace)
namespace
- the Namespace to addpublic void setLocation(Location location)
location
- the location of this Element in the document.public Location getLocation()
Copyright © 2024. All rights reserved.