public String importXML(String fileName,Properties ctx,String trxName) throws Exception {
  log.info("importXML:" + fileName);
  File in=new File(fileName);
  if (!in.exists()) {
    String msg="File does not exist: " + fileName;
    log.info("importXML:" + msg);
    return msg;
  }
  try {
    log.info("starting");
    System.setProperty("javax.xml.parsers.SAXParserFactory","org.apache.xerces.jaxp.SAXParserFactoryImpl");
    PackInHandler handler=new PackInHandler();
    handler.set_TrxName(trxName);
    handler.setCtx(ctx);
    handler.setProcess(this);
    SAXParserFactory factory=SAXParserFactory.newInstance();
    SAXParser parser=factory.newSAXParser();
    String msg="Start Parser";
    log.info(msg);
    parser.parse(in,handler);
    msg="End Parser";
    log.info(msg);
    return "OK.";
  }
 catch (  Exception e) {
    log.log(Level.SEVERE,"importXML:",e);
    throw e;
  }
}

public String importXML ( String fileName , Properties ctx , String trxName ) throws Exception { log . info ( "importXML:" + fileName ) ; File in = new File ( fileName ) ; if ( ! in . exists ( ) ) { String msg = "File does not exist: " + fileName ; log . info ( "importXML:" + msg ) ; return msg ; } try { log . info ( "starting" ) ; System . setProperty ( "javax.xml.parsers.SAXParserFactory" , "org.apache.xerces.jaxp.SAXParserFactoryImpl" ) ; PackInHandler handler = new PackInHandler ( ) ; handler . set_TrxName ( trxName ) ; handler . setCtx ( ctx ) ; handler . setProcess ( this ) ; SAXParserFactory factory = SAXParserFactory . newInstance ( ) ; SAXParser parser = factory . newSAXParser ( ) ; String msg = "Start Parser" ; log . info ( msg ) ; parser . parse ( in , handler ) ; msg = "End Parser" ; log . info ( msg ) ; return "OK." ; } catch ( Exception e ) { log . log ( Level . SEVERE , "importXML:" , e ) ; throw e ; } }
uses packinhandler to update ad .
