|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.hp.hpl.sparta.Node | +--com.hp.hpl.sparta.Element
An XML Element.
Copyright (C) 2002 Hewlett-Packard Company. This file is part of Sparta, an XML Parser, DOM, and XPath library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Element
Constructor Summary | |
Element(java.lang.String tagName)
|
Method Summary | |
void |
appendChild(Node addedChild)
|
java.lang.Object |
clone()
Create a deep clone of this Element. |
Element |
cloneElement(boolean deep)
Create a clone of this node. |
Element |
cloneShallow()
Create a shallow clone of this Element. |
boolean |
equals(java.lang.Object thatO)
To be equal elements must have the same tagname, they must have the same children (applying equals recursivly) in the same order and they must have the same attributes in any order. |
java.lang.String |
getAttribute(java.lang.String name)
|
java.util.Enumeration |
getAttributeNames()
Return enumeration of Strings |
Node |
getFirstChild()
|
Node |
getLastChild()
|
java.lang.String |
getTagName()
|
void |
removeAttribute(java.lang.String name)
|
void |
removeChild(Node childToRemove)
|
void |
replaceChild(Element newChild,
Node oldChild)
Replace oldChild with newChild. |
void |
replaceChild(Text newChild,
Node oldChild)
Replace oldChild with newChild. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
|
void |
setTagName(java.lang.String tagName)
|
void |
toXml(java.io.Writer writer)
Write XML representation to character stream. |
Element |
xpathSelectElement(java.lang.String xpath)
Select the first element that matches the relative XPath expression with respect to this element, or null if there is no match. |
java.util.Enumeration |
xpathSelectElements(java.lang.String xpath)
Select all the elements that match the relative XPath expression with respect to this element. |
java.lang.String |
xpathSelectString(java.lang.String xpath)
Select the first element that matches the relative XPath expression with respect to this element, or null if there is no match. |
java.util.Enumeration |
xpathSelectStrings(java.lang.String xpath)
Select all the strings that match the relative XPath expression with respect to this element. |
Methods inherited from class com.hp.hpl.sparta.Node |
getAnnotation, getNextSibling, getOwnerDocument, getParentNode, getPreviousSibling, htmlEncode, setAnnotation, toString, toXml, xpathEnsure, xpathSetStrings |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Element(java.lang.String tagName)
Method Detail |
public java.lang.Object clone()
clone
in class Node
public Element cloneShallow()
public Element cloneElement(boolean deep)
public java.lang.String getTagName()
public void setTagName(java.lang.String tagName)
public Node getFirstChild()
public Node getLastChild()
public java.util.Enumeration getAttributeNames()
public java.lang.String getAttribute(java.lang.String name)
public void setAttribute(java.lang.String name, java.lang.String value)
name
- attribute name which must be non-null, non emptyvalue
- attribue value.public void removeAttribute(java.lang.String name)
public void appendChild(Node addedChild) throws DOMException
public void removeChild(Node childToRemove) throws DOMException
public void replaceChild(Element newChild, Node oldChild) throws DOMException
DOMException
- if oldChild object is not a child.public void replaceChild(Text newChild, Node oldChild) throws DOMException
DOMException
- if oldChild object is not a child.public void toXml(java.io.Writer writer) throws java.io.IOException
public java.util.Enumeration xpathSelectElements(java.lang.String xpath) throws ParseException
xpathSelectElements
in class Node
public java.util.Enumeration xpathSelectStrings(java.lang.String xpath) throws ParseException
xpathSelectStrings
in class Node
public Element xpathSelectElement(java.lang.String xpath) throws ParseException
xpathSelectElement
in class Node
public java.lang.String xpathSelectString(java.lang.String xpath) throws ParseException
xpathSelectString
in class Node
public boolean equals(java.lang.Object thatO)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |