Code example for SAXParser: Parsing XML documents

Methods: getClass, getXMLReader, parse

0
                LOG.debug("SAXParserFactory class: " + saxParserFactory.getClass().getName());
            } 
            saxParserFactory.setValidating(validate);
            final SAXParser saxParser = saxParserFactory.newSAXParser();
            if (LOG.isDebugEnabled()) {
                LOG.debug("sax parser class" + saxParser.getClass().getName());
            } 
            final XMLReader xmlReader = saxParser.getXMLReader();
            if (LOG.isDebugEnabled()) {
                LOG.debug("XML reader class: " + xmlReader.getClass().getName());
            } 
            final XMLConfigurator xmlConfigurator = new XMLConfigurator();
            xmlReader.setErrorHandler(xmlConfigurator);
            setSAXFeature(xmlReader, "http://xml.org/sax/features/namespaces", NAMESPACE_AWARE);
            setSAXFeature(xmlReader, "http://xml.org/sax/features/namespace-prefixes", !NAMESPACE_AWARE);
            saxParser.parse(inputSource, xmlConfigurator);
        } catch (ParserConfigurationException pce) {
            throw new ProxoolException("Parser configuration failed", pce);
        } catch (SAXException se) {
            throw new ProxoolException("Parsing failed.", se);
        } catch (IOException ioe) {