加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

从XML文档生成LINQ to XML C#代码?

发布时间:2020-12-16 23:05:38 所属栏目:百科 来源:网络整理
导读:有没有人知道一个工具会从真正的 XML文档或片段生成LINQ to XML代码?它正在逆向工程生成XML的常见场景. 例如,我想提供一个XML片段作为这样的输入 root thingvalue/thing/root 并让它像这样生成等效的C#LINQ到XML代码片段 var x = new XElement("root",new X
有没有人知道一个工具会从真正的 XML文档或片段生成LINQ to XML代码?它正在逆向工程生成XML的常见场景.

例如,我想提供一个XML片段作为这样的输入

<root>
    <thing>value</thing>
</root>

并让它像这样生成等效的C#LINQ到XML代码片段

var x = new XElement("root",new XElement("thing",new XText("value"));
    );

虽然我正在寻找一个快速,但我确信一些有进取心的人会告诉我自己动手并提供一些很棒的参考代码.

解决方法

见 this工具.

the application supports :

  • XDocument
  • XDeclaration
  • XProcessingInstruction
  • XComment
  • XNamespace
  • XElement
  • XAttribute

  • generation of business objects

  • generation of code Linq To Xml (with variables,in method,extraction of
    the code corresponding to the selected
    nodes)

  • you can open a Xml file or directly copy to stick xml in the richtextbox

  • the editor allows to create Xml documents from scratch or to
    add/modify existing Xml documents
  • the editor has several views which are synchronized (Text,treeview)
  • a help with the seizure (auto completion tags and attributes and
    checking in the course of the good
    formation of xml) for the text view,…
  • you can also post the data of the nodes selected in a datagridview
  • etc

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读