SAXReader saxReader = new SAXReader();//解析器
OutputFormat outputFormat = OutputFormat.createPrettyPrint();// 设置编码方式
outputFormat.setEncoding("UTF-8");// 设置编码方式GBK
FileInputStream fileInputStream = new FileInputStream(file);//
document = saxReader.read(fileInputStream, "UTF-8");//读入文件
文件已存在
最新推荐文章于 2025-06-05 16:48:06 发布