如何使用asp.net生成XML树节点 [英] how to genrate XML tree node using asp.net

查看:59
本文介绍了如何使用asp.net生成XML树节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何生成XML节点我在webservice的表中有价值。

我的XML树注释结构就像是


how to genrate XML node i have value in table in webservice.
my XML tree note have structure is like

<parent>
<wife>

<child>
</child>
<child>
</child>
<child>
</child>
//its return multiple time how can genrate it suggest me.
</wife>
</parent>

推荐答案

是否要从ASP.net动态创建XML文件。

IF所以这个链接



http://social.msdn.microsoft.com/Forums/vstudio/en-US/ 847ffaef-891c-4e95-b9e6-bb5fb0b881fc / hi-i-want-to-create-xml-document-in-aspnet-dynamic?forum = csharpgeneral [ ^ ]



http://forums.asp.net/t/1407620.aspx?Good+Example+of+how+to+create+a+Xml+Document+Programmatically+ [ ^ ]



http://www.dotnetgallery.com/forum/thread45-How-to-generate-XML-in-aspnet.aspx [ ^ ]
Do you want to create XML file dynamically from ASP.net .
IF so chk this links

http://social.msdn.microsoft.com/Forums/vstudio/en-US/847ffaef-891c-4e95-b9e6-bb5fb0b881fc/hi-i-want-to-create-xml-document-in-aspnet-dynamically?forum=csharpgeneral[^]

http://forums.asp.net/t/1407620.aspx?Good+Example+of+how+to+create+a+Xml+Document+Programmatically+[^]

http://www.dotnetgallery.com/forum/thread45-How-to-generate-XML-in-aspnet.aspx[^]


这是一个简单的示例。我希望这可以帮助你获得一个基本的想法。





here is a simple sample.i hope this may help you to get a basic idea.


//Create XmlDocument
XmlDocument xmlDoc = new XmlDocument();

//Create the root element
XmlNode outputsElement = xmlDoc.CreateElement("outputs");

//Create the child element
XmlElement Element = xmlDoc.CreateElement("output");

//Create "name" Attribute
XmlAttribute nameAtt = xmldoc.CreateAttribute("name");
Element.Attributes.Append(nameAtt);

//Create "value" Attribute
XmlAttribute valueAtt = xmldoc.CreateAttribute("value");
Element.Attributes.Append(valueAtt);

//Create "type" Attribute
XmlAttribute typeAtt = xmldoc.CreateAttribute("type");
Element.Attributes.Append(typeAtt);

//Append child element into root element
outputsElement.AppendChild(Element);


我建​​议读这个:

演练:在TreeView控件中显示分层数据 [ ^ ]

ASP.NET中的分层数据绑定 [ ^ ]

绑定到分层数据 [ ^ ]
I would suggest to read this:
Walkthrough: Displaying Hierarchical Data in a TreeView Control[^]
Hierarchical Data Binding in ASP.NET[^]
Binding to Hierarchical Data[^]


这篇关于如何使用asp.net生成XML树节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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