public class Element extends Node
| 构造器和说明 |
|---|
Element(java.lang.String tagName) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
appendChild(Node addedChild)
Add node as child of this element, cloning node if it is this element or
an ancestor.
|
java.lang.Object |
clone() |
Element |
cloneElement(boolean deep) |
Element |
cloneShallow() |
protected int |
computeHashCode() |
boolean |
equals(java.lang.Object thatO) |
java.lang.String |
getAttribute(java.lang.String name) |
java.util.Enumeration |
getAttributeNames() |
Node |
getFirstChild() |
Node |
getLastChild() |
java.lang.String |
getTagName() |
void |
removeAttribute(java.lang.String name)
remove this attribute if it exists, otherwise silently do nothing.
|
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) |
boolean |
xpathEnsure(java.lang.String xpath) |
Element |
xpathSelectElement(java.lang.String xpath) |
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) |
java.util.Enumeration |
xpathSelectStrings(java.lang.String xpath)
Select all the strings that match the relative XPath expression with
respect to this element.
|
getAnnotation, getNextSibling, getOwnerDocument, getParentNode, getPreviousSibling, hashCode, htmlEncode, setAnnotation, toString, toXml, xpathSetStringspublic 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)
public void removeAttribute(java.lang.String name)
public void appendChild(Node addedChild)
public void removeChild(Node childToRemove) throws DOMException
DOMExceptionpublic 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
java.io.IOExceptionpublic java.util.Enumeration xpathSelectElements(java.lang.String xpath)
throws ParseException
xpathSelectElements 在类中 NodeParseExceptionpublic java.util.Enumeration xpathSelectStrings(java.lang.String xpath)
throws ParseException
xpathSelectStrings 在类中 NodeParseExceptionpublic boolean xpathEnsure(java.lang.String xpath)
throws ParseException
ParseExceptionpublic Element xpathSelectElement(java.lang.String xpath) throws ParseException
xpathSelectElement 在类中 NodeParseExceptionpublic java.lang.String xpathSelectString(java.lang.String xpath)
throws ParseException
xpathSelectString 在类中 NodeParseExceptionpublic boolean equals(java.lang.Object thatO)
equals 在类中 java.lang.Objectprotected int computeHashCode()
computeHashCode 在类中 Node