选择标签之间的数据 [英] Selecting data between tags

查看:52
本文介绍了选择标签之间的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是初学者。这个问题可能很愚蠢。但是我需要帮助。



I am a beginner . this question might be stupid. but i need help.

<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>







如何获取标签中的数据to。

这是在XDocument中

提前谢谢求助。



:)




how to get the data in the tag "to".
This is in a XDocument
Thank you in advance for the help.

:)

推荐答案

foreach (XElement hashElement in doc.Descendants("to"))
                    {
                        string hashValue = (string)hashElement;
                        OutputTextBlock.Text = hashValue;
                    }









是的我得到了.. :P





Yes i got it.. :P


您好,



请从我的博客中查看此帖子



http://juhi2012.wordpress.com/2012/08/ [ ^ ]



有get xmlnode to datatable的一个例子。

可能会对你有所帮助

让我知道。
Hello,

please refer this post from my blog

http://juhi2012.wordpress.com/2012/08/[^]

there is an example of get xmlnode to datatable.
might be it will helpful to you
let me know that.


这篇关于选择标签之间的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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