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
(C#) XML Parsing Example: Currency DataSimple example showing how to parse an XML file containing currency data.
Chilkat.Xml xml = 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 bool success; success = xml.LoadXmlFile("c:/myXmlFiles/currency.xml"); if (success != true) { textBox1.Text += xml.LastErrorText + "\r\n"; return; } // Iterate over each "CURRENCY" child node and display the contents: Chilkat.Xml curr = null; int n; int i; n = xml.NumChildrenHavingTag("CURRENCY"); for (i = 0; i <= n - 1; i++) { curr = xml.GetNthChildWithTag("CURRENCY",i); textBox1.Text += "----" + "\r\n"; textBox1.Text += "Name: " + curr.GetChildContent("NAME") + "\r\n"; textBox1.Text += "Code: " + curr.GetChildContent("CURRENCYCODE") + "\r\n"; textBox1.Text += "Country: " + curr.GetChildContent("COUNTRY") + "\r\n"; } |
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.