public interface Dom
| 限定符和类型 | 方法和说明 |
|---|---|
Element |
element(Element e,
String name)
Get a element by name
|
List<Element> |
elements(Element e)
Get the children elements
|
List<Element> |
elements(Element e,
String name)
Get the children elements by element name
|
Document |
getDocument(String file)
Get the XML document
|
Element |
getRoot(Document doc)
Get the root node
|
String |
getTextValue(Element valueElement)
Get the value of a XML element
|
String |
getTextValueByTagName(Element e,
String name)
Get the value of a XML node
|
String |
getTextValueByTagName(Element e,
String name,
String defaultValue)
Get the value of a XML node
|
Document getDocument(String file)
file - The file relative pathElement getRoot(Document doc)
doc - XML document object;List<Element> elements(Element e)
e - A current XML elementList<Element> elements(Element e, String name)
e - A current XML elementname - Element nameElement element(Element e, String name)
e - A current XML elementname - The child node nameString getTextValue(Element valueElement)
valueElement - The value nodeString getTextValueByTagName(Element e, String name)
e - Current XML elementname - The child node nameString getTextValueByTagName(Element e, String name, String defaultValue)
e - Current XML elementname - The child node namedefaultValue - Default text value, when the child node is not found or the
child node has not text value, the method return itCopyright © 2016. All rights reserved.