chatelain Posted October 24, 2005 Posted October 24, 2005 (edited) 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 it's 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> [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 Edited October 24, 2005 by chatelain Quote
Machaira Posted October 28, 2005 Posted October 28, 2005 Wouldn't you just do: inbox.RemoveChild(email) Quote Here's what I'm up to.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.