private void createParent() throws SAXException { XMLReader parent = null; try { SAXParserFactory pfactory = SAXParserFactory.newInstance(); pfactory.setNamespaceAware(true); if (_transformer.isSecureProcessing()) { try { pfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (SAXException e) {} } SAXParser saxparser = pfactory.newSAXParser(); parent = saxparser.getXMLReader(); } catch (ParserConfigurationException e) { throw new SAXException(e); } catch (FactoryConfigurationError e) { throw new SAXException(e.toString()); } if (parent == null) { parent = XMLReaderFactory.createXMLReader(); } // make this XMLReader the parent of this filter setParent(parent); }
public void parse (InputSource input) throws SAXException, IOException { XMLReader managedReader = null; try { if (getParent() == null) { try { managedReader = XMLReaderManager.getInstance() .getXMLReader(); setParent(managedReader); } catch (SAXException e) { throw new SAXException(e.toString()); } } // call parse on the parent getParent().parse(input); } finally { if (managedReader != null) { XMLReaderManager.getInstance().releaseXMLReader(managedReader); } } }
private void createParent() throws SAXException { XMLReader parent = null; try { SAXParserFactory pfactory = SAXParserFactory.newInstance(); pfactory.setNamespaceAware(true); if (_transformer.isSecureProcessing()) { try { pfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (SAXException e) {} } SAXParser saxparser = pfactory.newSAXParser(); parent = saxparser.getXMLReader(); } catch (ParserConfigurationException e) { throw new SAXException(e); } catch (FactoryConfigurationError e) { throw new SAXException(e.toString()); } if (parent == null) { parent = XMLReaderFactory.createXMLReader(); } // make this XMLReader the parent of this filter setParent(parent); }
public void parse (InputSource input) throws SAXException, IOException { XMLReader managedReader = null; try { if (getParent() == null) { try { managedReader = XMLReaderManager.getInstance() .getXMLReader(); setParent(managedReader); } catch (SAXException e) { throw new SAXException(e.toString()); } } // call parse on the parent getParent().parse(input); } finally { if (managedReader != null) { XMLReaderManager.getInstance().releaseXMLReader(managedReader); } } }