Class used to parse the xml into objects.
Created: Feb 23, 2003 Copyright: Copyright (c) 2003 Assumptions: none Requires: nothing Required by: XmlReader Revision History: 2003-04-21 Changed to use JAXP instead of Xerces.
200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
{ SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(true); factory.setNamespaceAware(true); ReaderContentHandler handler = new ReaderContentHandler(targetPackage); try { SAXParser parser = factory.newSAXParser(); parser.parse(inputStream, handler); } catch (ParserConfigurationException pce) { try { factory.setValidating(false); factory.setNamespaceAware(false); SAXParser parser = factory.newSAXParser(); parser.parse(inputStream, handler); } catch(Exception e) { throw new XmlException(EX_PARSING + e.toString()); } } catch (SAXException se) { if (se.getException() instanceof XmlException) throw (XmlException)(se.getException()); throw new XmlException(EX_PARSING + se.toString()); } catch (IOException ioe) { throw new XmlException(EX_PARSING + ioe.toString()); } rootObject = handler.getResult(); handler = null; result = true; } // end try to read xml finally {