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
精彩评论