<? The XML version="1.0" encoding="GBK"?>
CodePudding user response:
File File=new File (sourcePath);//configuration path
InputStream in=new FileInputStream (file);
SAXReader reader=new SAXReader ();
Document doc=reader. Read (in);
The Iterator elementIter=null, subelementIter=null;
Element Element=null, subelement=null;
String paramName="";
String paramValuehttps://bbs.csdn.net/topics/="";
int count=0;
//read the configuration file
ElementIter=doc. SelectNodes ("/p/d "). The iterator ();
While (elementIter. HasNext ()) {
Element=(element) elementIter. Next ();
ParamName=element. AttributeValue (" sname ");//in order to obtain the is Tom, dick and harry fifty
}
CodePudding user response:
Take out attributes to read and write in your entity class