Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (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 by chatelain

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...