如题!
如果将一个XML文件的XMLNODE 添加到另一个XML文件中
如果将一个XML文件的XMLNODE 添加到另一个XML文件中
解决方案 »
- asp.net 问题
- 求EXCEL导入ACCESS数据库的实例
- 数据库有一DateTime字段,我程序里设计的这个字段是可以为空的.如果为空的话怎么存进数据库,怎么让在程序中显示NULL而不是0001.1.1.00:00:
- 请问asp.net web 应用程序与asp.net网站具体有什么区别?
- 显示及更新
- 用网页如何制作评估问卷
- 求高手指点:将<meta>标签输出在<html>外面,会不会有什么问题??
- DataGrid問題,如何單擊單元格,讓下一個單元格獲得一個值
- 送给大家的礼物<-----附加码生产程序----->庆贺教师节
- 关于后台采用定时器调用函数修改页面上的数据的问题
- ********高手请进!!不知是不是巨难???,200分求解决DataList嵌套DataList后显示的问题************
- 请各位帮忙看看这段ASP.NET中datagrid分页怎么不行?
using System.IO;
using System.Xml;public class Class1
{
public static void Main()
{
//Create the XmlDocument.
XmlDocument doc = new XmlDocument();
doc.LoadXml("<bookstore>" +
"<book genre='novel' ISBN='1-861001-57-5'>" +
"<title>Pride And Prejudice</title>" +
"</book>" +
"</bookstore>"); //Create another XmlDocument which holds a list of books.
XmlDocument doc2 = new XmlDocument();
doc2.Load("books.xml"); //Import the last book node from doc2 into the original document.
XmlNode newBook = doc2.ImportNode(doc.DocumentElement.LastChild, true);
doc2.DocumentElement.AppendChild(newBook);
doc2.Save("books.xml");
}
}
该示例使用文件 books.xml
<?xml version='1.0'?>
<!-- This file represents a fragment of a book store inventory database -->
<bookstore>
<book genre="autobiography" publicationdate="1981" ISBN="1-861003-11-0">
<title>The Autobiography of Benjamin Franklin</title>
<author>
<first-name>Benjamin</first-name>
<last-name>Franklin</last-name>
</author>
<price>8.99</price>
</book>
<book genre="novel" publicationdate="1967" ISBN="0-201-63361-2">
<title>The Confidence Man</title>
<author>
<first-name>Herman</first-name>
<last-name>Melville</last-name>
</author>
<price>11.99</price>
</book>
<book genre="philosophy" publicationdate="1991" ISBN="1-861001-57-6">
<title>The Gorgias</title>
<author>
<name>Plato</name>
</author>
<price>9.99</price>
</book>
</bookstore>