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
  • 相关阅读:
    数组和对象常用方法汇总
    基于vue的悬浮碰撞窗口(用于打广告的)组件
    时间的基本处理
    防抖动和节流阀
    A. 配置xftp和xshell来远程管理Linux服务器
    课堂练习-找水王
    评价软件
    构建之法阅读笔记02
    学习进度条博客11
    用户场景
  • 原文地址:https://www.cnblogs.com/starcrm/p/1362780.html
Copyright © 2011-2022 走看看