|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xml.sax.helpers.DefaultHandler org.xBaseJ.XBASEXMLParser
Field Summary | |
org.apache.xerces.parsers.SAXParser |
parser
SAX parser |
Constructor Summary | |
XBASEXMLParser()
constructor, sets up SAX parser, turns off validation, turns on namespaces, sets up content handler and error handler as this object. |
Method Summary | |
void |
characters(char[] ch,
int start,
int length)
catches the element's value |
void |
endElement(String uri,
String localName,
String rawName)
Method called by the SAX parser at the |
void |
error(SAXParseException e)
catches error SAXParseExceptions this code causes exception to continue |
void |
fatalError(SAXParseException e)
catches fatal SAXParseExceptions this code causes exception to continue |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
I use this to keep track of line #s |
static void |
main(String[] args)
accepts on String parameter, filename to parse |
void |
parse(String inXMLFile)
makes the SAX2 parser call |
void |
startElement(String uri,
String localName,
String rawName,
Attributes attributes)
method called for each xml element found. |
void |
warning(SAXParseException e)
catches warning SAXParseExceptions this code sends exception to stdio and allows public classto continue |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public org.apache.xerces.parsers.SAXParser parser
Constructor Detail |
public XBASEXMLParser()
Method Detail |
public static void main(String[] args)
public void parse(String inXMLFile)
inXMLFile
- String of filename to parsepublic void startElement(String uri, String localName, String rawName, Attributes attributes) throws SAXException
uri
- URI of incoming filelocalName
- String of element's local namerawName
- String of element's raw nameattributes
- Vector of the elements attributes
SAXException
- many possible exceptionspublic void characters(char[] ch, int start, int length) throws SAXException
ch
- char array of the current element value contentsstart
- int start position within the arraylength
- int of characters found so far
SAXException
- many possiblepublic void endElement(String uri, String localName, String rawName) throws SAXException
uri
- URI of incoming filelocalName
- String of element's local namerawName
- String of element's raw name
SAXException
- many possiblepublic void ignorableWhitespace(char[] ch, int start, int length)
ch
- char array of found whitespacesstart
- int start position in arraylength
- int length of what's been foundpublic void warning(SAXParseException e) throws SAXException
e
- SaxException object
SAXException
- exceptionpublic void error(SAXParseException e) throws SAXException
e
- SaxException object
SAXException
- thrownpublic void fatalError(SAXParseException e) throws SAXException
e
- SAXException object
SAXException
- thrown
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |