开发者

Simple LINQ to XML query

This one is my simple XML

 Dim Xml = <BODY ID="1">
   <HEAD1>
    <Eyes type="S" l="1" f="1"></Eyes>
   </HEAD1>
   <HEAD2>
    <Eyes type="S" l="1" f="1"></Eyes>
   </HEAD2>
开发者_如何学Go   </BODY>

How can i write a LINQ query to return as result the following?

HEAD1
HEAD2


I can give you the answer in C# (and try to convert it to VB.Net)

var result = from element in xml.Root.Elements()
             select element.Name;

this may be VB.Net code:

Dim result = From element In xml.Root.Elements Select element.Name
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜