![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(ASP) XML Parsing Example: Currency DataSimple example showing how to parse an XML file containing currency data.
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <% set xml = Server.CreateObject("Chilkat_9_5_0.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 Response.Write "<pre>" & Server.HTMLEncode( xml.LastErrorText) & "</pre>" 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_9_5_0.Xml Set curr = xml.GetNthChildWithTag("CURRENCY",i) Response.Write "<pre>" & Server.HTMLEncode( "----") & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Name: " & curr.GetChildContent("NAME")) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Code: " & curr.GetChildContent("CURRENCYCODE")) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Country: " & curr.GetChildContent("COUNTRY")) & "</pre>" Next %> </body> </html> |
||||
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.