org.xml.sax.SAXParseException: Invalid byte 1 of 1-byte UTF-8 sequence.
这个问题的解决:
// 生成的xml的格式
OutputFormat format = OutputFormat.createPrettyPrint();
// 生成的xml文档路径
String path = "D:/Documents and Settings/Administrator/workspace/GDS/config/graph/gisproducts/S002.xml";
把:
XMLWriter writer = new XMLWriter(new FileWriter(path), format);
改成如下:就可以了
XMLWriter writer = new XMLWriter(new FileOutputStream(path), format);
写的够简洁吧,呵呵!
这个问题的解决:
// 生成的xml的格式
OutputFormat format = OutputFormat.createPrettyPrint();
// 生成的xml文档路径
String path = "D:/Documents and Settings/Administrator/workspace/GDS/config/graph/gisproducts/S002.xml";
把:
XMLWriter writer = new XMLWriter(new FileWriter(path), format);
改成如下:就可以了
XMLWriter writer = new XMLWriter(new FileOutputStream(path), format);
写的够简洁吧,呵呵!