Ok,
Here is my XML File, it's pretty simple:
<?xml version="1.0" encoding="utf-8" ?>
<Dispositions>
<Group Name="Unused">
<Disp>NA</Disp>
<Disp>TCB</Disp>
<Disp>WPC</Disp>
</Group>
<Group Name="Refusals">
<Disp>PM</Disp>
<Disp>REF</Disp>
<Disp>SVN</Disp>
<Disp>SFV</Disp>
<Disp>KO</Disp>
<Disp>UNV</Disp>
<Disp>VTCB</Disp>
</Group>
<Group Name="Voids">
<Disp>AO</Disp>
<Disp>DISC</Disp>
<Disp>INEL</Disp>
<Disp>LB</Disp>
<Disp>MC</Disp>
<Disp>WRN</Disp>
</Group>
<Group Name="Sales">
<Disp>RS</Disp>
<Disp>SALE</Disp>
<Disp>SI</Disp>
<Disp>SIE</Disp>
<Disp>VS</Disp>
<Disp>WCS</Disp>
</Group>
<Group Name="DNC">
<Disp>DNC</Disp>
</Group>
</Dispositions>
Here is the code I am using:
Dim doc As System.Xml.XmlDocument
doc = New XmlDocument
doc.Load("Dispositions.xml")
Dim Root As XmlElement = doc.DocumentElement
Dim node As XmlNodeList
node = Root.SelectNodes("/Dispositions/Group/@Name")
Dim i As Integer
Dim j As Integer
For i = 0 To node.Count - 1 Step i + 1
Debug.WriteLine("-" & node.Item(i).Value)
Dim sNodes As XmlNodeList =
node(i).SelectNodes("/Dispositions/Group[Name=" & node.Item(i).Value &
"]/Disp/text()")
For j = 0 To sNodes.Count - 1 Step j + 1
Debug.WriteLine("--" & sNodes.Item(j).Value)
Next
Next
Right now it only lists this:
-Unused
-Refusals
-Voids
-Sales
-DNC
What I want to do is, depending on the user, they will click a button
that will grab all <Disp> underneath a specific <Group
name="whatever"></Group>
These are actually codes to be used in a sql query that will grab
certain records.
This is my first time working with XML in dotnet and I am quite
confused. Where can i go to get a basic understanding of the Nodes,
Nodelists, etc....
Can anyone tell me how to accomplish what it is i'm trying to do here.
thank you.