?運(yùn)行之后,,沒有生成newbooks.xml是怎么回事????????
ArrayList<Book> booklist=parsexml();
SAXTransformerFactory factory=(SAXTransformerFactory)SAXTransformerFactory.newInstance();
try {
TransformerHandler tfh=factory.newTransformerHandler();
Transformer tf=tfh.getTransformer();
tf.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
tf.setOutputProperty(OutputKeys.INDENT, "yes");
File f=new File("src/rec/newbooks.xml");
if(!f.exists()){
f.createNewFile();?
} ?
Result res = new StreamResult(new FileOutputStream(f));
tfh.setResult(res);
tfh.startDocument();
AttributesImpl atts = new AttributesImpl();
tfh.startElement("", "", "bookstore", atts);
tfh.endElement("", "","bookstore");
tfh.endDocument()
運(yùn)行之后,,沒有生成newbooks.xml是怎么回事????????
2016-09-21
是不是沒有寫主方法調(diào)用創(chuàng)建xml文件的方法?
2016-06-14
刷新了 也沒有
2016-06-14
未刷新?