org.jscience.linguistics.kif
Class BasicXMLparser

java.lang.Object
  extended by org.jscience.linguistics.kif.BasicXMLparser

public class BasicXMLparser
extends java.lang.Object

Parses simple XML into a hierarchy of BasicXMLelement (s). Used instead of SAX because that class is so complex. The right thing to do is probably to subclass SAX or create some simpler utility class that makes using it easier. This class assumes that each XML tag is on its own line and that every attribute value is enclosed in single or double quotes.


Field Summary
 java.util.ArrayList elements
          An ArrayList of BasicXMLelement(s).
 
Constructor Summary
BasicXMLparser(java.lang.String xml)
          ************************************************************** Constructor that parses an XML-formatted string, with one tag per line, into an ArrayList of BasicXMLelement (s).
 
Method Summary
static void main(java.lang.String[] args)
          Test method.
 java.lang.String toString()
          Convert the XML hierarchy to a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

elements

public java.util.ArrayList elements
An ArrayList of BasicXMLelement(s).

Constructor Detail

BasicXMLparser

public BasicXMLparser(java.lang.String xml)
************************************************************** Constructor that parses an XML-formatted string, with one tag per line, into an ArrayList of BasicXMLelement (s).

Method Detail

toString

public java.lang.String toString()
Convert the XML hierarchy to a String.

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

main

public static void main(java.lang.String[] args)
Test method.

Parameters:
args - DOCUMENT ME!