Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Xml VB6 Multiple Node Problem

Status
Not open for further replies.

kennedymr2

Programmer
May 23, 2001
594
AU
This is the abreviated xml
'*************************

<Pool Type="XX" Available="Y">
<Dividend Id="629" Amount="12.8000">
<DivResult No="1" RNo="2"/>
</Dividend>
<Dividend Id="6291" Amount="13.8000">
<DivResult No="1" RNo="4"/>
</Dividend>
</Pool>

VB6 Code.... working ok

Set oxmlNodeList = xmldoc.selectNodes("//Pool")

For intNode = 0 To oxmlNodeList.length - 1
For intAttr = 0 To oxmlNodeList(intNode).Attributes.length - 1
List2.AddItem oxmlNodeList(intNode).Attributes.getNamedItem("Type").Text
Next
'*** This is where i need to get NO & Rno ie Pick up both DivResults
'Ie I need some child code of some sort ??????
'eg List2.AddItem XX,12.80,1,2
' List2.AddItem XX,13.80,1,4

Next


NOT THIS *********
Using this i can get all the info BUT i cannot associate it with the Header //Pool

Set oxmlNodeList = xmldoc.selectNodes("//Pool/Dividend")

For intNode = 0 To oxmlNodeList.length - 1
For intAttr = 0 To oxmlNodeList(intNode).Attributes.length - 1
List2.AddItem oxmlNodeList(intNode).Attributes.getNamedItem("Id").Text
List2.AddItem oxmlNodeList(intNode).Attributes.getNamedItem("Amount").Text
Next
Next


Really appreciate any help

Regards Kennedymr2

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top