摘要:
//加载指定的XML文档 XmlDocument doc = new XmlDocument(); doc.Load("sampledata2.xml"); //或者通过 XmlDocument 载入 XmlTextReader 类的对象来加载XML文件 //XmlTextReader reader = new XmlTextReader("sampledata.txt"); //doc.Load(reader); //读取XML节点数据 X... 阅读全文
摘要:
XmlTextWriter textWriter = new XmlTextWriter("sampledata2.xml", null); //设置格式,对元素内容进行缩进 textWriter.Formatting = Formatting.Indented; //书写XML声明 textWriter.WriteStartDocument(); //写出在名称和文本之间带有空格的处理指令 String pitext = "type='t... 阅读全文