Remove parent AND child node

chatelain

Member
Joined
Oct 19, 2005
Messages
5
Can someone suggest a way to do this? Remove the children AND the node itself. The way I understand it is node.RemoveAll() only removes its children.
XML:
<?xml version="1.0" encoding="utf-8" ?>
<Inbox>
<mailCount type="integer"></mailCount>
<email>
<uidl>1234</uidl>
</email>
<email>
<uidl>5678</uidl>
</email
<email>
<uidl>9999</uidl>
</email
</Inbox>
Code:
[B][COLOR=DimGray]Vb.net[/COLOR][/B]  
Private Function UidlPro(ByVal uidl As String)
        Dim xmlUidl As XmlDocument = New XmlDocument
        Dim inbox As XmlNodeList
        Dim email As XmlNode
        xmlUidl.Load(uidlPath)
        inbox = xmlUidl.SelectNodes("Inbox/email")
        For Each email In inbox
            If uidl.Equals((email.ChildNodes(0).Value)) Then
                 [COLOR=Blue][B]Remove me and my children[/B][/COLOR]
            End If
        Next
End Function

Thanks,
Aaron
 
Last edited by a moderator:
Back
Top