|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umbc.cs.daml4jess.XmlUtil
XML untility class. It has some utility method such as obtaining the text value of a node, printing the tree structure of a document, etc.
Constructor Summary | |
XmlUtil()
|
Method Summary | |
static java.util.List |
getChildElementsByName(org.w3c.dom.Node parent,
java.lang.String tagName)
Get the list of direct child element nodes with the given tag name. |
static org.w3c.dom.Element |
getFirstChildElementByName(org.w3c.dom.Node parent,
java.lang.String tagName)
Find the first direct child element with given tagName. |
static java.lang.String |
getFirstChildValueByName(org.w3c.dom.Node parent,
java.lang.String tagName)
Get the value for the first direct child element node with the given tag name. |
static java.lang.String |
getNodeValue(org.w3c.dom.Node node)
Get the value of the given node. |
static void |
printTree(org.w3c.dom.Document doc)
Print the given xml document tree. |
static void |
printTree(org.w3c.dom.Node root,
int level)
Recursively print the given xml document node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XmlUtil()
Method Detail |
public static java.util.List getChildElementsByName(org.w3c.dom.Node parent, java.lang.String tagName)
public static java.lang.String getFirstChildValueByName(org.w3c.dom.Node parent, java.lang.String tagName)
on how the value is computed.
public static org.w3c.dom.Element getFirstChildElementByName(org.w3c.dom.Node parent, java.lang.String tagName)
parent
- the node whose child element will be search.tagName
- name of the node to be found from the parent's
direct children.
public static java.lang.String getNodeValue(org.w3c.dom.Node node)
node
- the node whose value will be calculated.
public static void printTree(org.w3c.dom.Document doc)
doc
- the document which will be printed out.public static void printTree(org.w3c.dom.Node root, int level)
level
- current level (from root node).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |