Thanks for your comments.
I have attempted a structure similar to your advice, but I am receiving a peculiar outcome.
I have a loop that goes through a nodlist:
For Each node In NodeList
saveNodeAttributes(node)
Next node
Then setup the other function for the recursion:
Public Sub saveNodeAttributes(ByVal Node As Xml.XmlNode)
Dim attribute As Xml.XmlAttribute
If Not Node.Attributes Is Nothing Then
For Each attribute In Node.Attributes
logIt.dBug(attribute.Name)
Next attribute
End If
If Node.HasChildNodes Then
saveNodeAttributes(Node.FirstChild)
ElseIf Not Node.NextSibling Is Nothing Then
saveNodeAttributes(Node.NextSibling)
ElseIf Not Node.ParentNode.NextSibling Is Nothing Then
saveNodeAttributes(Node.ParentNode.NextSibling)
End If
End Sub
It checks to see if the node has any "children", if it does then select the "firstchild". If not check if there are any "siblings", if not then go back to the "parent" and choose the next sibling.
This however is outputting the 2nd half of the document's attributes twice?
Any idea what could be wrong?
Thanks,
Francis
|