|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectscone.util.XMLHelper
public class XMLHelper
an XML helper class. This class provides easy parsing of XML documents and simple access methods for DOMs.
| Constructor Summary | |
|---|---|
XMLHelper()
|
|
| Method Summary | |
|---|---|
static org.w3c.dom.Node |
getAttribute(java.lang.String name,
org.w3c.dom.Node node)
returns the first attribute of node with the specified name, or null otherwise |
static org.w3c.dom.Node |
getChild(java.lang.String name,
org.w3c.dom.Node node)
returns the first child node of node with the specified name, or null otherwise |
static void |
main(java.lang.String[] args)
test method |
static org.w3c.dom.Document |
parseReader(java.io.Reader reader)
parses a Reader into a DOM. |
static void |
printNodeStructure(org.w3c.dom.Node node,
java.lang.String indent)
prints a simple structure of a Node and its children. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLHelper()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
public static org.w3c.dom.Document parseReader(java.io.Reader reader)
throws java.lang.Exception
reader - a reader containing an XML document
java.lang.Exception
public static void printNodeStructure(org.w3c.dom.Node node,
java.lang.String indent)
node - a Nodeindent - set this to an empty String!
public static org.w3c.dom.Node getAttribute(java.lang.String name,
org.w3c.dom.Node node)
name - the name of the attributenode - the node
public static org.w3c.dom.Node getChild(java.lang.String name,
org.w3c.dom.Node node)
name - the name of the childnode - the node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||