首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

xpathnavigator怎么给xml文档添加encoding属性

2011-12-31 
xpathnavigator如何给xml文档添加encoding属性?xmldocumentdocnewxmldocument()xpathnavigatorxpdoc.cr

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 "?> 会自动添加吧

热点排行