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
|
|
(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.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.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-2012 Chilkat Software, Inc. All Rights Reserved.