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
Navigate to Content in XMLDemonstrates how to retrieve "Bears" from the following XML:
<?xml version="1.0" encoding="utf-8" ?>
<sports>
<baseball>
<mlb>
<chicago>Cubs</chicago>
<new_york>Yankees</new_york>
</mlb>
</baseball>
<football>
<chicago>Bears</chicago>
<new_york>Jets</new_york>
</football>
<basketball>
<chicago>Bulls</chicago>
<new_york>Knicks</new_york>
</basketball>
</sports>
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, CHILKATXMLLib_TLB, OleCtrls; ... procedure TForm1.Button1Click(Sender: TObject); var xml: CHILKATXMLLib_TLB.IChilkatXml; success: Integer; xml2: CHILKATXMLLib_TLB.IChilkatXml; xml3: CHILKATXMLLib_TLB.IChilkatXml; begin xml := TChilkatXml.Create(Self).ControlInterface; // Assume the XML is contained in the file: sports.xml success := xml.LoadXmlFile('sports.xml'); if (success <> 1) then begin Memo1.Lines.Add(xml.LastErrorText); Exit; end; xml2 := xml.GetChildWithTag('football'); xml3 := xml2.GetChildWithTag('chicago'); Memo1.Lines.Add(xml3.Content); end; |
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.