I am working with data saved in XML and looking to manage quite a lot of data.
In Visual Studio I have tried coding but, unfortunately, without success.
Sub neki()
Dim objXLDoc As XDocument = XDocument.Load("c:\MyXml.xml")
Dim objQuery = objXLDoc.Element("List").Elements("List2").Attributes("name")
For Each objResult As XAttribute In objQuery
Console.WriteLine(objResult.Name.ToString() & " = " &
objResult.Value.ToString)
Next
End Sub
XML sample
<?xml version="1.0" standalone="yes"?>
<MyInfo xmlns="http://www.myside.com">
<StandardHeader local="SPR" />
<List>
<List2 MyInfoId="123" MyProd="Box" name="5-1" />
<List2 MyInfoId="124" MyProd="Box1" name="5-2" />
<List2 MyInfoId="125" MyProd="Box2" name="5-3" />
<List2 MyInfoId="126" MyProd="Box3" name="5-4"/>
<List2 MyInfoId="127" MyProd="Box4" name="5-5"/>
<List2 MyInfoId="128" MyProd="Box5" name="5-6"/>
<List2 MyInfoId="129" MyProd="Box6" name="5-7"/>
<List2 MyInfoId="130" MyProd="Box7" name="5-8"/>
<List2 MyInfoId="131" MyProd="Box8" name="5-9"/>
<List2 MyInfoId="132" MyProd="Box9" name="5-10"/>
</List>
</MyInfo>
I would like to read/import all data (MyInfoId, MyProd, name) for each "List2" row in the table.