Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
(VB.NET) XML Parsing Example: Currency DataSimple example showing how to parse an XML file containing currency data.
Dim xml As New Chilkat.Xml() ' The Chilkat XML component is freeware. ' Load an XML document. ' This file is available at http://www.chilkatsoft.com/testData/currency.xml Dim success As Boolean success = xml.LoadXmlFile("c:/myXmlFiles/currency.xml") If (success <> true) Then TextBox1.Text = TextBox1.Text & xml.LastErrorText & vbCrLf Exit Sub End If ' Iterate over each "CURRENCY" child node and display the contents: Dim curr As Chilkat.Xml Dim n As Long Dim i As Long n = xml.NumChildrenHavingTag("CURRENCY") For i = 0 To n - 1 curr = xml.GetNthChildWithTag("CURRENCY",i) TextBox1.Text = TextBox1.Text & "----" & vbCrLf TextBox1.Text = TextBox1.Text & "Name: " & curr.GetChildContent("NAME") & vbCrLf TextBox1.Text = TextBox1.Text & "Code: " & curr.GetChildContent("CURRENCYCODE") & vbCrLf TextBox1.Text = TextBox1.Text & "Country: " & curr.GetChildContent("COUNTRY") & vbCrLf Next |
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.