Delphi Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Delphi Examples

Bounced Mail
Bz2
Character Encoding
CSV
DKIM / DomainKey
Digital Certificates
Digital Signatures
DH Key Exchange
DSA
Email
Email Object
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
NTLM
POP3
RSA
S/MIME
SMTP
Socket
Spider
SFTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Byte Array
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

Type Conversion

 

Article: Understanding COM References in Delphi

How to use GetParent and GetParent2

How to use GetParent and GetParent2. This is a snippet of the document used in this example:

uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls,
    CHILKATXMLLib_TLB,
    OleCtrls;

...

procedure TForm1.Button1Click(Sender: TObject);
var
xml0: CHILKATXMLLib_TLB.IChilkatXml;
xml: CHILKATXMLLib_TLB.IChilkatXml;
bookNode: CHILKATXMLLib_TLB.IChilkatXml;
titleNode: CHILKATXMLLib_TLB.IChilkatXml;
bookNode2: CHILKATXMLLib_TLB.IChilkatXml;
str1: String;
str2: String;
str3: String;

begin

xml0 := TChilkatXml.Create(Self).ControlInterface;

//  The Chilkat XML component is freeware.

//  Load an XML document.  Typically you might call LoadXml
//  to load an XML file.  This example loads an XML file from
//  a URL:
xml := xml0.HttpGet('http://www.chilkatsoft.com/testData/bookstore.xml');

//  The xml object points to the root node of the XML document.

//  Set bookNode equal to the 1st child of the root.

bookNode := xml.GetChild(0);

//  Set titleNode equal to the title child of bookNode:

titleNode := bookNode.GetChildWithTag('title');

//  Call GetParent to return a new object pointing to the parent node:

bookNode2 := titleNode.GetParent();

//  bookNode2 and bookNode point to the same node.

//  Call GetParent2 (which returns nothing) to modify the internal
//  pointer within the calling object so that it points to the immediate parent:
titleNode.GetParent2();

//  Now titleNode points to the same node as bookNode2 and bookNode.
//  To prove it, generate the XML sub-tree rooted at the calling
//  node and display each:

str1 := bookNode.GetXml();
str2 := bookNode2.GetXml();
str3 := titleNode.GetXml();

Memo1.Lines.Add(str1);
Memo1.Lines.Add(str2);
Memo1.Lines.Add(str3);

end;

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Email Component · XML Parser