Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicPythonRubySQL ServerSwiftTclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcel

C++ Examples

Async
Certificates
ECC
Email Object
Encryption
FTP
HTML-to-XML/Text
Gzip
HTTP
IMAP
JSON
Jwt
MHT / HTML Email
PEM
PFX/P12
Java KeyStore (JKS)
OAuth2
POP3
RSA Encryption
MIME
REST
SCP
SMTP
Socket/SSL/TLS
SSH Key
SSH
SSH Tunnel
SFTP
Stream
Tar Archive
XML
XMP
Zip

More Examples...
OpenSSL
Facebook
Google APIs
Google Cloud Storage
Azure Cloud Storage
Amazon S3 (new)
Google Drive
Dropbox
Amazon SQS
Amazon SNS
Amazon SES
Firebase
ASN.1
PRNG
Amazon S3
Bounced Email
CSV
Diffie-Hellman
DKIM / DomainKey
DSA
NTLM
QuickBooks
Spider
Digital Signatures

 

 

 

 

 

 

 

(C++) Compress XML Tree

Demonstrates how to compress and restore the entire subtree rooted at an XML node.

The input XML, available at http://www.chilkatsoft.com/data/compress2.xml, is this:

<root>
    <lazydog>
        <fox>The quick brown fox jumps over the lazy dog</fox>
    </lazydog>
    <fox>The quick brown fox jumps over the lazy dog</fox>
    <child>
        <grandchild>The quick brown fox jumps over the lazy dog</grandchild>
    </child>
    <child>
        <grandchild>The quick brown fox jumps over the lazy dog</grandchild>
    </child>
</root>

Chilkat C/C++ Library Downloads

MS Visual C/C++

Linux/CentOS/Heroku C/C++

MAC OS X C/C++

C++ Builder

Solaris C/C++

iOS C/C++

Android C/C++

Raspberry Pi C/C++

Windows Mobile 5.0/Pocket PC 2003

ARM Embedded Linux C/C++

PowerLinux C/C++

FreeBSD C/C++

MinGW C/C++

#include <CkXml.h>

void ChilkatSample(void)
    {
    CkXml xml;

    bool success;
    //  The sample input XML is available at http://www.chilkatsoft.com/data/compress2.xml
    success = xml.LoadXmlFile("compress2.xml");
    if (success != true) {
        std::cout << xml.lastErrorText() << "\r\n";
        return;
    }

    //  Zip compress the root node's entire subtree:
    success = xml.ZipTree();

    //  Examine the new XML document:
    std::cout << xml.getXml() << "\r\n";

    //  This is the XML w/ the compressed subtree in Base64 encoded format:
    
/*
<root><![CDATA[4+WyKcrPL7Hj5VIAApucxKrKlPx0KBcslJZfYReSkapQWJqZnK2QVJRfnqcAFFPIKs0tKFbIL0st
UigBSoN0KgC12uiDNECN00c1jyKzkjMyc1KQHZZelJiXAhElyUwkfTBnovDoYZGNPjTUAQ==
]]></root>
*/ // Now uncompress and show that the original subtree was restored: success = xml.UnzipTree(); std::cout << xml.getXml() << "\r\n"; }
 

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