如何将XML转换为表单控件文本? [英] How to Convert the XML to Form Controls Text?

查看:135
本文介绍了如何将XML转换为表单控件文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我有一个xml文件.当我上载该xml文件并单击提交"按钮时,标签内的内容应显示在标签中,特定标签的值应显示在该标签的对应文本框中.

请帮帮我.

在此先感谢.

Hi All,
I hav one xml file.when i upload that xml file and click the submit button ,The content inside the tag should be displayed in label and the value for particular tag should be displayed in coreesponding textbox for that label.

please help me.

Thanks in Advance.

推荐答案



您必须像这样使用XML文档

Hi,

You''l have to use XML document like this

XmlDocument xd = new XmlDocument();
                xd.LoadXml(xmltoread);//loading XML
                var node = xd.GetElementsByTagName(nodename)[0];//reading node name [0],if  node no is > 0
                var outcome = node.Attributes["outcome"].Value;//End//printing in a variable or any control


您可以使用 LINQ to XML [ ^ ]一种非常简单的查询方法用于XML数据.

基本查询(LINQ to XML) [
You can use LINQ to XML[^] a really easy way to query for XML data.

Basic Queries (LINQ to XML)[^] samples.


这篇关于如何将XML转换为表单控件文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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