XmlUtils
Class XmlReader

java.lang.Object
  |
  +--XmlUtils.XmlReader

public class XmlReader
extends java.lang.Object

A standard reader for reading XML data files


Constructor Summary
XmlReader()
          default constructor; not valid
XmlReader(java.lang.String name)
          This constructor calls a validating parser for name
XmlReader(java.lang.String name, boolean v)
          The XmlReader method actually reads the file with name name.
 
Method Summary
 java.lang.String getError()
          returns the error
 java.lang.String getFirst(java.lang.String nodename)
          getFirst returns the first element with name name
 org.w3c.dom.Element getRoot()
          get the root Element of the XML data file
static void main(java.lang.String[] args)
          This method is used for testing only
 org.w3c.dom.Element openFile()
          get the root Element of the XML data file
 void print(java.lang.Object s)
           
 void println(java.lang.Object s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlReader

public XmlReader()
default constructor; not valid

XmlReader

public XmlReader(java.lang.String name,
                 boolean v)
          throws java.lang.Exception
The XmlReader method actually reads the file with name name.
Parameters:
v - if v then a validating parser is used
Throws:
java.lang.Exception - if the XML code is non valid, or the file does not exist then an exception is thrown

XmlReader

public XmlReader(java.lang.String name)
          throws java.lang.Exception
This constructor calls a validating parser for name
Throws:
java.lang.Exception - passes the exceptions thrown
Method Detail

print

public void print(java.lang.Object s)

println

public void println(java.lang.Object s)

getRoot

public org.w3c.dom.Element getRoot()
get the root Element of the XML data file

openFile

public org.w3c.dom.Element openFile()
get the root Element of the XML data file

getFirst

public java.lang.String getFirst(java.lang.String nodename)
getFirst returns the first element with name name
Parameters:
nodename - The name for the element

getError

public java.lang.String getError()
returns the error

main

public static void main(java.lang.String[] args)
This method is used for testing only