|
This
should be a pretty simple question. Running the following
code:
try {
XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser"); parser.setContentHandler(contentHandler); parser.setErrorHandler(errorHandler); parser.setEntityResolver(new FeedEntityResolver(dtdPath)); parser.setFeature("http://xml.org/sax/features/validation", true); try { parser.parse(uri); } catch (IOException e) { throw new FeedException("IOException, error reading URI: " + e.getMessage(), e); } catch (SAXException e) { e.printStackTrace(); throw new FeedException("Error in parsing: " + e.getMessage(), e); } } catch (SAXException e) { throw new FeedException("Unable to create parser.", e); } where
contentHandler is a valid ContentHandler
errorHandler is a valid ErrorHandler
FeedEntityResolver is a valid Entity Resolver
uri is
a valid absolute filename.
I am
having the following Exception thrown:
java.lang.NullPointerException
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:878) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:900) No
methods on my ErrorHandler, ContentHandler, or EntityResolver are ever getting
called. Does anyone have any idea what I am missing? The problem
seems to be contained within the parser code....
Any
help is greatly appreciated.
Brad
|
- carriage return in attribute not preserved Greg Matthews
- RE: NullPointerException trying to parse a simple XML f... Brad O'Hearne
- RE: NullPointerException trying to parse a simple X... Brad O'Hearne
- Re: NullPointerException trying to parse a simple X... Elena Litani
- Windows Paths Brad O'Hearne
- Re: Windows Paths Milind Gadre
- RE: Windows Paths Brad O'Hearne
- RE: carriage return in attribute not preserved Sam Pullara
- Re: carriage return in attribute not preserved Tom Bradford
- Re: carriage return in attribute not preserved Greg Matthews
