1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| /* Cree le parser XML */
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setAttribute (JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
dbf.setValidating (false);
DocumentBuilder db = dbf.newDocumentBuilder ();
doc = db.parse (new InputSource (new StringReader (xmlData)));
} catch (ParserConfigurationException ex) {
logger.log (Logger.ERROR, "ParserConfigurationException : " + ex.getMessage ());
return false;
} catch (SAXException ex) {
logger.log (Logger.ERROR, "SAXException : " + ex.getMessage ());
return false;
} catch (IOException ex) {
logger.log (Logger.ERROR, "IOException : " + ex.getMessage ());
ex.printStackTrace (System.out);
return false;
} catch (FactoryConfigurationError ex) {
logger.log (Logger.ERROR, "FactoryConfigurationError : " + ex.getMessage ());
return false;
} |