zoukankan      html  css  js  c++  java
  • Linq to xml: XDocument对象

                XDocument d = new XDocument(
        new XComment("This is a comment."),
        new XProcessingInstruction("xml-stylesheet",
            "href='mystyle.css' title='Compact' type='text/css'"),
        new XElement("Pubs",
            new XElement("Book",
                new XElement("Title", "Artifacts of Roman Civilization"),
                new XElement("Author", "Moreno, Jordao")
            ),
            new XElement("Book",
                new XElement("Title", "Midieval Tools and Implements"),
                new XElement("Author", "Gazit, Inbar")
            )
        ),
        new XComment("This is another comment.")
    );
                d.Declaration = new XDeclaration("1.0", "utf-8", "true");
                Console.WriteLine(d);

                d.Save("c:/test.xml");

    关于作者: 王昕(QQ:475660) 在广州工作生活30余年。十多年开发经验,在Java、即时通讯、NoSQL、BPM、大数据等领域较有经验。
    目前维护的开源产品:https://gitee.com/475660
  • 相关阅读:
    Jmeter之Bean shell使用(一)
    CSS知识点 2
    0523 CSS知识点
    0522 HTML表单 CSS基础
    0521 HTML基础
    0515线程
    0514 队列 管道 进程池 回调函数
    0510进程 multiprocess模块
    0509操作系统发展史 进程
    0507黏包
  • 原文地址:https://www.cnblogs.com/starcrm/p/1362780.html
Copyright © 2011-2022 走看看