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>
Thanks,
Aaron
XML:
<?xml version="1.0" encoding="utf-8" ?>
<Inbox>
<mailCount type="integer"></mailCount>
<email>
<uidl>1234</uidl>
</email>
<email>
<uidl>5678</uidl>
<email>
<uidl>9999</uidl>
</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: