|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.xBaseJ.XBaseXmlParser
public class XBaseXmlParser
This class is courtesy of the xBaseJ project: http://xbasej.sourceforge.net/ Copyright 1997-2007 - American Coders, LTD - Raleigh NC USA
American Coders, Ltd P. O. Box 97462 Raleigh, NC 27615 USA 1-919-846-2014 http://www.americancoders.com
| Constructor Summary | |
|---|---|
XBaseXmlParser()
constructor, sets up SAX parser, turns off validation, turns on namespaces, sets up content handler and error handler as this object. sax exceptions go to System.err |
|
| 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 |
| Constructor Detail |
|---|
public XBaseXmlParser()
| Method Detail |
|---|
public static void main(String[] args)
public void parse(String inXMLFile)
inXMLFile - String of filename to parse
public void startElement(String uri,
String localName,
String rawName,
Attributes attributes)
throws SAXException
startElement in interface ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandleruri - URI of incoming filelocalName - String of element's local namerawName - String of element's raw nameattributes - Vector of the elements attributes
SAXException - many possible exceptions
public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerch - char array of the current element value contentsstart - int start position within the arraylength - int of characters found so far
SAXException - many possible
public void endElement(String uri,
String localName,
String rawName)
throws SAXException
endElement in interface ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandleruri - URI of incoming filelocalName - String of element's local namerawName - String of element's raw name
SAXException - many possible
public void ignorableWhitespace(char[] ch,
int start,
int length)
ignorableWhitespace in interface ContentHandlerignorableWhitespace in class org.xml.sax.helpers.DefaultHandlerch - char array of found whitespacesstart - int start position in arraylength - int length of what's been found
public void warning(SAXParseException e)
throws SAXException
warning in interface ErrorHandlerwarning in class org.xml.sax.helpers.DefaultHandlere - SaxException object
SAXException - exception
public void error(SAXParseException e)
throws SAXException
error in interface ErrorHandlererror in class org.xml.sax.helpers.DefaultHandlere - SaxException object
SAXException - thrown
public void fatalError(SAXParseException e)
throws SAXException
fatalError in interface ErrorHandlerfatalError in class org.xml.sax.helpers.DefaultHandlere - SAXException object
SAXException - thrown
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||