Esempio n. 1
0
  static Parser makeParser(boolean validate) {

    SAXParserFactory factory = makeParserFactory(validate, false);

    try {
      return factory.newSAXParser().getParser();
    } catch (ParserConfigurationException ex) {
      notifyNewSAXParserEx(ex);
      return null;
    } catch (SAXException ex) {
      notifyNewSAXParserEx(ex);
      return null;
    }
  }
Esempio n. 2
0
  /** Return XML reader or null if no provider exists. */
  static XMLReader makeXMLReader(boolean validating, boolean namespaces) {

    SAXParserFactory factory = makeParserFactory(validating, namespaces);

    try {
      return factory.newSAXParser().getXMLReader();
    } catch (ParserConfigurationException ex) {
      notifyNewSAXParserEx(ex);
      return null;
    } catch (SAXException ex) {
      notifyNewSAXParserEx(ex);
      return null;
    }
  }