try {
if (xmlFileName.length() == 1) {
throw (new Exception("xml Filename not exist!!"));
}
SAXParser parser;
SOSSAXParserXML sample;
try {
// Create a new handler for the parser
sample = new SOSSAXParserXML();
// Get an instance of the parser
parser = new SAXParser();
}
catch (Exception e) {
sosLogger.warn("SAXParser Not found " + e);
throw (new Exception("SAXParser Not found " + e));
}
// set validation mode
if (isCheckValidate()) {
parser.setFeature("http://xml.org/sax/features/validation", true);
}
// Set Handlers in the parser
parser.setContentHandler(sample);
parser.setEntityResolver(sample);
parser.setDTDHandler(sample);
parser.setErrorHandler(sample);
// Convert file to URL and parse
try {
//spooler_log.info("createURL(xmlFileName): " + createURL(xmlFileName));
parser.parse(createURL(xmlFileName).toString());
//parser.parse(new org.xml.sax.InputSource(inputStream));
}
catch (SAXParseException e) {
sosLogger.debug5(
"Exception by Parsing/Validation - SAXParseXML.parseXMLFile() " + e);