com.usefullittlethings.saw.xml
Class MiniXMLParser
java.lang.Object
|
+--com.usefullittlethings.saw.xml.MiniXMLParser
- public class MiniXMLParser
- extends java.lang.Object
This class defines a VERY simple xml parser, with limited functionality.
It has many restrictions and may not be suitable for some applications.
Restrictions include the following:
- Duplicate tags names are not permitted (anywhere in the document)
- Comments are not supported
- Character data must be located immediately following the opening tag an
before and nested tags.
- Tag attributes must be enclosed in double quotes ("")
Method Summary |
java.lang.String |
getAttribute(java.lang.String tag,
java.lang.String key)
|
java.lang.String |
getFragment(java.lang.String tag)
|
java.lang.String |
getValue(java.lang.String tag)
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MiniXMLParser
public MiniXMLParser(java.lang.String xml)
throws java.text.ParseException
MiniXMLParser
public MiniXMLParser(java.lang.String xml,
boolean fragment)
throws java.text.ParseException
getValue
public java.lang.String getValue(java.lang.String tag)
throws java.text.ParseException
java.text.ParseException
getAttribute
public java.lang.String getAttribute(java.lang.String tag,
java.lang.String key)
throws java.text.ParseException
java.text.ParseException
getFragment
public java.lang.String getFragment(java.lang.String tag)
throws java.text.ParseException
java.text.ParseException
main
public static void main(java.lang.String[] args)