View Single Post
  #3 (permalink)  
Old February 27th, 2009, 08:03 PM
Old Pedant Old Pedant is offline
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

See if this works:
Code:
Sub ShowOneNode( theNode ) 
    Dim atts, att, nodeinfo
    nodeinfo = theNode.NodeName

    Set atts = theNode.Attributes
    If Not ( atts Is Nothing ) Then
        For Each att In atts
            nodeinfo = nodeinfo & " [" & att.Name & "=" & att.Value & "]"
        Next
    End If
    MsgBox( "Node: " & nodeinfo )
    
    Dim kids, kid
    Set kids = theNode.ChildNodes
    If Not ( kids Is Nothing ) Then
        For Each kid In kids
            ShowOneNode( kid )
        Next
    End If
End Sub
All off the top of my head and untested. If you hand me a sample XML file, though, I'd be willing to test it out.
Reply With Quote