xpathnavigator如何给xml文档添加encoding属性?
xmldocument doc = new xmldocument();
xpathnavigator xp = doc.createnavigator();
xp.appendchild( " <root> </root> ");
doc.save( "d:\\books.xml ");
我现在想在创建出的books.xml的第一行加上 <?xml version= "1.0 " encoding= "UTF-8 "?>
该怎么做?
------解决方案-------------------- <?xml version= "1.0 " encoding= "UTF-8 "?> 会自动添加吧