Linq To XML - How to?

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi, there!
Maybe I miss something, but I need help to know why my code doesnt work.
Im trying to search data in the following file:
<pre lang="x-xml <?xml version="1.0" encoding="utf-8" ?>
<LABTOOLS xmlns="urn:oric:examples:labtools
<Analists>
<LastUpdate>30/12/2010 13:31:52</LastUpdate>
<Analist>
<Name>Gabriel</Name>
</Analist>
<Analist>
<Name>Claudionor</Name>
</Analist>
<Analist>
<Name>Jesser</Name>
</Analist>
<Analist>
<Name>Agberto</Name>
</Analist>
</Analists>
</LABTOOLS>
[/code]
For this task, I wrote the code:
<pre lang="x-vbnet Imports System.Xml.Linq
Imports <xmlns="urn:oric:examples:labtools

Module Module1

Sub Main()

Dim LBT = XDocument.Load("D:Meus documentosVisual StudioLaboratoryLinqLabToolsLabToolsLabToolsXMLFile1.xml")
Dim teste = From p In LBT...<Analists>
Where p.<Analist>.<Name>.Value = "Claudionor"
Select p.<Analist>

For Each n In teste
Console.Write(n.Value.ToString)
Next

Console.ReadLine()
End Sub

End Module[/code]
<div style="background-color:white; color:black When I run the code, it doesnt find the Analistas name "Claudionor".<br/>
What Am I doing wrong?
Many thanks for any kind of help.
Best regards,
<
Ciro<br/>
<br/>

View the full article
 
Back
Top