VB.NET Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB.NET Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML to XML
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
PFX
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar Archive
Upload
XML
XMP
Zip Compression
Misc

More Examples...
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

Byte Array
VB.NET FTPS
System.IO

 

 

 

 

 

 

Delete Nodes from XML

Download Chilkat .NET for 2.0 / 3.5 Framework

Download Chilkat .NET for 1.0 / 1.1 Framework

VB.NET sample code showing how to delete nodes from an XML document.

    ' Remove the Microsoft record from the XML file.
    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        Dim xml As New Chilkat.Xml()
        Xml.LoadXmlFile("companies.xml")

        xml.FirstChild2()
        Dim microsoft As Chilkat.Xml
        microsoft = xml.FindNextRecord("name", "Microsoft*")

        Xml.GetRoot2()

        ' The Microsoft record is now root itself.
        Microsoft.RemoveFromTree()

        ' Save the XML with the Microsoft record removed.
        Xml.SaveXml("msRemoved.xml")

        ' Save the Microsoft record by itself.
        Microsoft.SaveXml("microsoft.xml")

    End Sub


The companies.xml file should contain this XML:
<?xml version="1.0" encoding="iso-8859-1" ?>
<companies><company><name>Chilkat Software, Inc.</name>
<address>1719 E Forest Ave</address>
<city>Wheaton</city>
<state>IL</state>
<zip>60187</zip>
<website>http://www.chilkatsoft.com</website>
<phone>630-784-9670</phone>
</company>
<company><name>Microsoft Corporation</name>
<address>One Microsoft Way</address>
<city>Redmond</city>
<state>WA</state>
<zip>98052</zip>
<website>http://www.microsoft.com</website>
<phone>425-882-8080</phone>
</company>
<company><name>Intel Corporation</name>
<address>2200 Mission College Blvd.</address>
<city>Santa Clara</city>
<state>CA</state>
<zip>95052</zip>
<website>http://www.intel.com</website>
<phone>408-765-8080</phone>
</company>
<company><name>Adobe Systems Incorporated</name>
<address>345 Park Avenue</address>
<city>San Jose</city>
<state>CA</state>
<zip>95110</zip>
<website>http://www.adobe.com</website>
<phone>408-536-6000</phone>
</company>
</companies>

Important: The download for this example does not contain the ChilkatDotNet.dll which
must be downloaded and installed separately at http://www.chilkatsoft.com/downloads.asp.
Once installed, add a reference to the DLL in the project by following the instructions at
http://www.example-code.com/vbdotnet/step2.asp

 
 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.

Mail Component · XML Parser