XMLParser.java 文件源码

java
阅读 36 收藏 0 点赞 0 评论 0

项目:Hydrograph 作者:
/**Parses the XML to fetch parameters.
 * @param inputFile, source XML  
 * @return true, if XML is successfully parsed.
 * @throws Exception 
 */
public boolean parseXML(File inputFile,UIComponentRepo componentRepo) throws ParserConfigurationException, SAXException, IOException{
     LOGGER.debug("Parsing target XML for separating Parameters");
        SAXParserFactory factory = SAXParserFactory.newInstance();
        SAXParser saxParser;
    try {
        factory.setFeature(Constants.DISALLOW_DOCTYPE_DECLARATION,true);
        saxParser = factory.newSAXParser();
        XMLHandler xmlhandler = new XMLHandler(componentRepo);
        saxParser.parse(inputFile, xmlhandler);
        return true;
    } catch (ParserConfigurationException | SAXException | IOException exception) {
         LOGGER.error("Parsing failed...",exception);
        throw exception; 
    }
  }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号