[size=x-large]
Node接口
继承其的接口有:Document,Element,Text,Attr.
Node的属性nodeName,nodeValue,attributes用get方法可得到
Document无父节点(他是最大的了嘛)。Attr,DOM不会将它看作文档树的一部分,所以,父节点,
兄弟节点为空。
接口 Node
Node的字段
static short的字段
ATTRIBUTE_NODE ,DOCUMENT_NODE ,ELEMENT_NODE ,TEXT_NODE .
Node的方法
得到节点相关信息
String getNodeName()
String getNodeValue()
void setNodeValue(String nodeValue)
boolean hasAttributes()
NamedNodeMap getAttributes()
String getTextContent() //不知有什么效果
void setTextContent(String textContent)
short getNodeType()
Document getOwnerDocument()
Node getParentNode()
Node getNextSibling()
Node getPreviousSibling()
boolean hasChildNodes()
NodeList getChildNodes()
Node getFirstChild()
Node getLastChild()
Node appendChild(Node newChild)
Node insertBefore(Node newChild, Node refChild)
Node replaceChild(Node newChild, Node oldChild)
Node removeChild(Node oldChild)
boolean isEqualNode(Node arg)
boolean isSameNode(Node other)
Node cloneNode(boolean deep) //不知有什么效果
接口 Document
Element getElementById(String elementId)
NodeList getElementsByTagName(String tagname)
Attr createAttribute(String name)
Element createElement(String tagName)
Text createTextNode(String data)
String getInputEncoding()
String getXmlEncoding()
String getXmlVersion()
void setXmlVersion(String xmlVersion)
Node adoptNode(Node source)
Node importNode(Node importedNode, boolean deep)
Node renameNode(Node n, String namespaceURI, String qualifiedName)
接口 Element
String getTagName()
boolean hasAttribute(String name)
String getAttribute(String name)
Attr getAttributeNode(String name)
void setAttribute(String name, String value)
Attr setAttributeNode(Attr newAttr)
void removeAttribute(String name)
Attr removeAttributeNode(Attr oldAttr)
void setIdAttribute(String name, boolean isId)
void setIdAttributeNode(Attr idAttr, boolean isId)
NodeList getElementsByTagName(String name)
接口 Text
String getWholeText()
boolean isElementContentWhitespace()
Text replaceWholeText(String content)
Text splitText(int offset)
接口 Attr
String getName()
String getValue()
void setValue(String value)
boolean isId()
Element getOwnerElement()
TypeInfo getSchemaTypeInfo()
[/size]
Node接口
继承其的接口有:Document,Element,Text,Attr.
Node的属性nodeName,nodeValue,attributes用get方法可得到
Document无父节点(他是最大的了嘛)。Attr,DOM不会将它看作文档树的一部分,所以,父节点,
兄弟节点为空。
接口 Node
Node的字段
static short的字段
ATTRIBUTE_NODE ,DOCUMENT_NODE ,ELEMENT_NODE ,TEXT_NODE .
Node的方法
得到节点相关信息
String getNodeName()
String getNodeValue()
void setNodeValue(String nodeValue)
boolean hasAttributes()
NamedNodeMap getAttributes()
String getTextContent() //不知有什么效果
void setTextContent(String textContent)
short getNodeType()
Document getOwnerDocument()
Node getParentNode()
Node getNextSibling()
Node getPreviousSibling()
boolean hasChildNodes()
NodeList getChildNodes()
Node getFirstChild()
Node getLastChild()
Node appendChild(Node newChild)
Node insertBefore(Node newChild, Node refChild)
Node replaceChild(Node newChild, Node oldChild)
Node removeChild(Node oldChild)
boolean isEqualNode(Node arg)
boolean isSameNode(Node other)
Node cloneNode(boolean deep) //不知有什么效果
接口 Document
Element getElementById(String elementId)
NodeList getElementsByTagName(String tagname)
Attr createAttribute(String name)
Element createElement(String tagName)
Text createTextNode(String data)
String getInputEncoding()
String getXmlEncoding()
String getXmlVersion()
void setXmlVersion(String xmlVersion)
Node adoptNode(Node source)
Node importNode(Node importedNode, boolean deep)
Node renameNode(Node n, String namespaceURI, String qualifiedName)
接口 Element
String getTagName()
boolean hasAttribute(String name)
String getAttribute(String name)
Attr getAttributeNode(String name)
void setAttribute(String name, String value)
Attr setAttributeNode(Attr newAttr)
void removeAttribute(String name)
Attr removeAttributeNode(Attr oldAttr)
void setIdAttribute(String name, boolean isId)
void setIdAttributeNode(Attr idAttr, boolean isId)
NodeList getElementsByTagName(String name)
接口 Text
String getWholeText()
boolean isElementContentWhitespace()
Text replaceWholeText(String content)
Text splitText(int offset)
接口 Attr
String getName()
String getValue()
void setValue(String value)
boolean isId()
Element getOwnerElement()
TypeInfo getSchemaTypeInfo()
[/size]