天天看點

讀取SPRING XML配置檔案中的hbm.xml 檔案清單.

String P="E://baosteel_sgm//src//ApplicationContext.xml";SAXReader saxReader = new SAXReader();Document document = saxReader.read(new File(P));

//查詢ElementString xpath ="/beans/bean[@id='sessionFactory']/property[@name='mappingResources']/list/value";//查詢屬性type='ondDelete'的compositeString oridir="E://baosteel_sgm//src//";List sf= document.selectNodes(xpath);for(int i=0;i<sf.size();i++){Element node=(Element) sf.get(i);String file=oridir+ node.getText();BOMRemover.trimBom(file);System.out.println(node.getText());}

Powered by Zoundry

轉載于:https://blog.51cto.com/5505294/930284