读取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

你可能感兴趣的:(查询,document,配置文件,的)