如何将元素添加到xml [英] how to add elements to xml

查看:82
本文介绍了如何将元素添加到xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将元素或节点添加到现有xml文档中?

示例:我有这个:

How i can add elements or nodes to an existing xml document?

Example: I have this:

<comprobante>
<complento />
</comprobante>


想要得到这个


and want get this

<comprobante>
<complento />
  <tdf:timbre and="" more="" information="" here="" xmlns:tdf="#unknown">
</tdf:timbre></comprobante>



有人可以告诉我该怎么做吗?非常感谢.
谢谢

格式,拼写,语法[Yvan Rodrigues]



Can someone show me how to do it? Really appreciated.
thanks

formatting, spelling, grammar [Yvan Rodrigues]

推荐答案

检查以下页面:

使用XmlTextReader和XmlTextWriter类以及C#读写XML文档:
http://msdn.microsoft.com/nl-NL/vcsharp/aa336739.aspx [ ^ ]

XML文档教程:
http://msdn.microsoft.com/en-us/library/aa288481 (v = VS.71).aspx [ http://msdn.microsoft.com/en-us/vcsharp/aa336738 [ ^ ]
Check these pages:

Reading and Writing XML Documents with the XmlTextReader and XmlTextWriter Class and C#:
http://msdn.microsoft.com/nl-NL/vcsharp/aa336739.aspx[^]

XML Documentation Tutorial:
http://msdn.microsoft.com/en-us/library/aa288481(v=VS.71).aspx[^]

Link to other tutorials and samples:
http://msdn.microsoft.com/en-us/vcsharp/aa336738[^]


这篇关于如何将元素添加到xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆