如何在xmldocument类中编写两个节点 [英] how to write two node in xmldocument class

查看:111
本文介绍了如何在xmldocument类中编写两个节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用xmldocument类编写两个节点并将自己的元素放在每个节点中
一个节点用于员工,另一个节点用于部门
就像
<员工>
< empid>
< empname>


<部门>
< depid>
< depname>

how can I write two nodes using xmldocument class and put own elements in each node
one node is for employees and other is for departments
just such as
<employees>
<empid>
<empname>


<departments>
<depid>
<depname>

推荐答案

您是说要拥有2个根节点?据我所知(我敢肯定这会违反XML标准).因此,您的选择是:将这两个节点都放在一个根节点中,或制作2个XML文档.
Do you mean, like having 2 root nodes? You can''t as far as I know (I''m pretty sure that would violate the XML standard). So your options are: put both of these nodes into a single root node, or make 2 XML documents.


这篇关于如何在xmldocument类中编写两个节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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