|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectfr.ensta.xml.XmlReader
A simple class for reading a xml hierarchy given by a xml file and displaying it.
This class is based on the Java XML tutorial, which can be found under http://java.sun.com/xml/jaxp/learning/tutorial/index.html
Created on 08.03.2005
| Constructor Summary | |
XmlReader()
|
|
| Method Summary | |
static void |
print(org.w3c.dom.Node node)
A recursive function to print a xml tree in Preorder Notation. |
static void |
print(org.w3c.dom.Node node,
int level)
A recursive function to print a xml tree in Preorder Notation. |
static void |
printIntelligent(org.w3c.dom.Node node)
A recursive function to print a xml tree in an intelligent way in Preorder Notation. |
static void |
printIntelligent(org.w3c.dom.Node node,
int level)
A recursive function to print a xml tree in Preorder Notation. |
static org.w3c.dom.Node |
readXmlFile(java.lang.String filename)
This function reads an xml file and return the root node of the xml tree. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XmlReader()
| Method Detail |
public static org.w3c.dom.Node readXmlFile(java.lang.String filename)
This function reads an xml file and return the root node of the xml tree.
filename - The name and path of the xml configuration filepublic static void print(org.w3c.dom.Node node)
Attention! This function only prints Text, Comment and Element Nodes! Other node types will be ignored!
node - the node in the tree from where to start. This is usually the root node.
public static void print(org.w3c.dom.Node node,
int level)
Attention! This function only prints Text, Comment and Element Nodes! Other node types will be ignored!
node - actual node to be processedlevel - the level of this node which will result in apropriate spacing in front of the printed string.public static void printIntelligent(org.w3c.dom.Node node)
Attention! This function only prints Text, Comment and Element Nodes! Other node types will be ignored!
node - the node in the tree from where to start. This is usually the root node.
public static void printIntelligent(org.w3c.dom.Node node,
int level)
Attention! This function only prints Text, Comment and Element Nodes! Other node types will be ignored!
node - actual node to be processedlevel - the level of this node which will result in apropriate spacing in front of the printed string.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||