Click here to Skip to main content
12,444,189 members (45,217 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB6
I am successfully parse an xml file with this code.
The code is returning all value for the normal tags, but not for the lists.
IE: I get all the value for 1,2,3 & 5 but never for 4
Hope this is clear enough

Public Function GetNodeValue(ByRef Nodes As MSXML2.IXMLDOMNodeList) As String
Dim xNode As MSXML2.IXMLDOMNode
For Each xNode In Nodes
If xNode.nodeType = NODE_TEXT Then
GetNodeValue = xNode.parentNode.nodeName & ":" & xNode.nodeValue
Select Case xNode.parentNode.nodeName
Case "1"
Debug.Print xNode.nodeValue
Case "2"
Debug.Print xNode.nodeValue
Case "3"
Debug.Print xNode.nodeValue
Case Else
'This line never returns a value
Debug.Print xNode.nodeValue
End Select
End If
If xNode.hasChildNodes Then
GetNodeValue xNode.childNodes
End If
Next
Set xNode = Nothing
End Function

Here is an example of the XML:
 <domain:STUFF>
<1>00000000000017</1>
Posted 18-Apr-10 8:39am
xardoz420

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160811.3 | Last Updated 26 Apr 2010
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100