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
(VBScript) XML Parsing Example: Currency DataSimple example showing how to parse an XML file containing currency data. Dim fso, outFile Set fso = CreateObject("Scripting.FileSystemObject") Set outFile = fso.CreateTextFile("output.txt", True) set xml = CreateObject("Chilkat.Xml") ' The Chilkat XML component is freeware. ' Load an XML document. ' This file is available at http://www.chilkatsoft.com/testData/currency.xml success = xml.LoadXmlFile("c:/myXmlFiles/currency.xml") If (success <> 1) Then outFile.WriteLine(xml.LastErrorText) WScript.Quit End If ' Iterate over each "CURRENCY" child node and display the contents: n = xml.NumChildrenHavingTag("CURRENCY") For i = 0 To n - 1 ' curr is a Chilkat.Xml Set curr = xml.GetNthChildWithTag("CURRENCY",i) outFile.WriteLine("----") outFile.WriteLine("Name: " & curr.GetChildContent("NAME")) outFile.WriteLine("Code: " & curr.GetChildContent("CURRENCYCODE")) outFile.WriteLine("Country: " & curr.GetChildContent("COUNTRY")) Next outFile.Close |
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.