Visual Basic Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB Examples

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

More Examples...
Email Object
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA


VB Strings
VB Byte Array

Unreleased...
Bzip2
LZW
Icon

 

 

 

 

 

 

 

VB to Scan / Iterate Nodes in an XML Document

Download Chilkat XML ActiveX

Source Code Listing

' This example requires Chilkat XML v3.0.0
' Scan crisp.xml for ArticleTitles and
' create another XML document containing
' only the titles.
Private Sub Command1_Click()

    Label1.Caption = "Working..."
    Label1.Refresh
    
    Dim xml As New ChilkatXml
    Dim outXml As New ChilkatXml
    Dim node As ChilkatXml
    outXml.Tag = "article_titles"
    
    xml.LoadXmlFile "crisp.xml"

    ' Iterate over ArticleTitle tags regardless of where
    ' they occur in the document. Setting the first parameter
    ' to 0 causes the search to  from the document root.
    Set node = xml.SearchForTag(Nothing, "ArticleTitle")
    Do While Not (node Is Nothing)
    
        ' NewChild returns the created child, whereas NewChild2 does not.
        outXml.NewChild2 "article", node.Content

        ' Search for the next ArticleTitle tagged node beginning with the node
        ' just after the current node in a breadth-first document tree traversal.
        Set node = xml.SearchForTag(node, "ArticleTitle")
    
    Loop
    
    outXml.SaveXml "ArticleTitles1.xml"

    Label1.Caption = "Done."
    
End Sub

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

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