Visual C++ Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Delphi ActiveXDelphi DLLVisual FoxProJavaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerShellPythonRubySQL ServerUnicode CUnicode C++Visual Basic 6.0VB.NETVBScript

C++ Examples

CkString
Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
DH Key Exchange
DKIM/DomainKeys
Digital Certificates
Digital Signatures
DSA
Email
Email Object
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT / HTML Email
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH Key
SSH
SSH Tunnel
SFTP
Tar
Upload
XML
XMP
Zip Compression


More Examples...
Amazon S3
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

 

 

 

 

 

 

 

 

Building an XML Document

Demonstrates how to build the following XML document:

<accrep:AccidentReport>
  <accrep:VehicleSection>
    <accrep:Vehicle>
      <accrep:DriverOrPedestrian>D</accrep:DriverOrPedestrian>
      <accrep:Number>1</accrep:Number>
      <accrep:Name>
        <accrep:First>John</accrep:First>
        <accrep:Last>Doe</accrep:Last>
        <accrep:Middle>Robert</accrep:Middle>
      </accrep:Name>
      <accrep:Passengers>
        <accrep:Name>
          <accrep:First>John</accrep:First>
          <accrep:Last>Doe, Jr.</accrep:Last>
          <accrep:Middle>Robert</accrep:Middle>
        </accrep:Name>
      </accrep:Passengers>
      <accrep:Passengers>
	  <accrep:Name>
          <accrep:First>Sally</accrep:First>
          <accrep:Last>Doe</accrep:Last>
          <accrep:Middle>Crystal</accrep:Middle>
        </accrep:Name>
      </accrep:Passengers>
    </accrep:Vehicle>
    <accrep:Vehicle>
      <accrep:DriverOrPedestrian>D</accrep:DriverOrPedestrian>
      <accrep:Number>2</accrep:Number>
      <accrep:Name>
        <accrep:First>John</accrep:First>
        <accrep:Last>Public</accrep:Last>
        <accrep:Middle>Q</accrep:Middle>
      </accrep:Name>
      <accrep:Passengers>
        <accrep:Name>
          <accrep:First>Billy</accrep:First>
          <accrep:Last>Public</accrep:Last>
          <accrep:Middle>Bob</accrep:Middle>
        </accrep:Name>
      </accrep:Passengers>
      <accrep:Passengers>
	  <accrep:Name>
          <accrep:First>Kelly</accrep:First>
          <accrep:Last>Public</accrep:Last>
          <accrep:Middle>Emily</accrep:Middle>
        </accrep:Name>
      </accrep:Passengers>
    </accrep:Vehicle>
  </accrep:VehicleSection>
</accrep:AccidentReport>

Downloads:

MS Windows Visual C/C++ Libraries
Linux/CentOS C/C++ Libraries
MAC OS X C/C++ Libraries
Solaris C/C++ Libraries
C++ Builder Libraries
FreeBSD C++ Libraries
HP-UX C++ Libraries
BlackBerry QNX C++ Libraries
#include <CkXml.h>

void ChilkatSample(void)
    {
    CkXml xml1;
    xml1.put_Tag("accrep:AccidentReport");
    CkXml *xml2 = 0;
    xml2 = xml1.NewChild("accrep:VehicleSection","");
    CkXml *xml3 = 0;
    xml3 = xml2->NewChild("accrep:Vehicle","");
    xml3->NewChild2("accrep:DriverOrPedestrian","D");
    xml3->NewChild2("accrep:Number","1");
    CkXml *xml6 = 0;
    xml6 = xml3->NewChild("accrep:Name","");
    xml6->NewChild2("accrep:First","John");
    xml6->NewChild2("accrep:Last","Doe");
    xml6->NewChild2("accrep:Middle","Robert");
    delete xml6;
    CkXml *xml10 = 0;
    xml10 = xml3->NewChild("accrep:Passengers","");
    CkXml *xml11 = 0;
    xml11 = xml10->NewChild("accrep:Name","");
    xml11->NewChild2("accrep:First","John");
    xml11->NewChild2("accrep:Last","Doe, Jr.");
    xml11->NewChild2("accrep:Middle","Robert");
    delete xml11;
    delete xml10;
    CkXml *xml15 = 0;
    xml15 = xml3->NewChild("accrep:Passengers","");
    CkXml *xml16 = 0;
    xml16 = xml15->NewChild("accrep:Name","");
    xml16->NewChild2("accrep:First","Sally");
    xml16->NewChild2("accrep:Last","Doe");
    xml16->NewChild2("accrep:Middle","Crystal");
    delete xml16;
    delete xml15;
    delete xml3;
    CkXml *xml20 = 0;
    xml20 = xml2->NewChild("accrep:Vehicle","");
    xml20->NewChild2("accrep:DriverOrPedestrian","D");
    xml20->NewChild2("accrep:Number","2");
    CkXml *xml23 = 0;
    xml23 = xml20->NewChild("accrep:Name","");
    xml23->NewChild2("accrep:First","John");
    xml23->NewChild2("accrep:Last","Public");
    xml23->NewChild2("accrep:Middle","Q");
    delete xml23;
    CkXml *xml27 = 0;
    xml27 = xml20->NewChild("accrep:Passengers","");
    CkXml *xml28 = 0;
    xml28 = xml27->NewChild("accrep:Name","");
    xml28->NewChild2("accrep:First","Billy");
    xml28->NewChild2("accrep:Last","Public");
    xml28->NewChild2("accrep:Middle","Bob");
    delete xml28;
    delete xml27;
    CkXml *xml32 = 0;
    xml32 = xml20->NewChild("accrep:Passengers","");
    CkXml *xml33 = 0;
    xml33 = xml32->NewChild("accrep:Name","");
    xml33->NewChild2("accrep:First","Kelly");
    xml33->NewChild2("accrep:Last","Public");
    xml33->NewChild2("accrep:Middle","Emily");
    delete xml33;
    delete xml32;
    delete xml20;
    delete xml2;

    //  Display the XML:
    printf("%s\n",xml1.getXml());


    }

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