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
Unzip XML Sub-Trees
VB.NET sample code showing how to Unzip sub-trees within an XML document. ' Load an XML file that has Zipped data. Unzip it on-the-fly and use it.
' This example lists company names and addresses in a listbox.
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
Dim xml As New Chilkat.Xml()
Xml.LoadXmlFile("zipped.xml")
ListBox1.Items.Clear()
Dim b As Boolean
b = xml.FirstChild2()
While (b)
' Unzip the sub-tree.
xml.UnzipTree()
ListBox1.Items.Add(xml.GetChildContent("name"))
ListBox1.Items.Add(xml.GetChildContent("address"))
b = xml.NextSibling2()
End While
End Sub
The companies.xml file should contain this XML:
<?xml version="1.0" encoding="iso-8859-1" ?>
<companies>
<company>
<name>Chilkat Software, Inc.</name>
<address>1719 E Forest Ave</address>
<city>Wheaton</city>
<state>IL</state>
<zip>60187</zip>
<website>http://www.chilkatsoft.com</website>
<phone>630-784-9670</phone>
</company>
<company>
<name>Microsoft Corporation</name>
<address>One Microsoft Way</address>
<city>Redmond</city>
<state>WA</state>
<zip>98052</zip>
<website>http://www.microsoft.com</website>
<phone>555-882-8080</phone>
</company>
<company>
<name>Intel Corporation</name>
<address>2200 Mission College Blvd.</address>
<city>Santa Clara</city>
<state>CA</state>
<zip>95052</zip>
<website>http://www.intel.com</website>
<phone>555-765-8080</phone>
</company>
<company>
<name>Adobe Systems Incorporated</name>
<address>345 Park Avenue</address>
<city>San Jose</city>
<state>CA</state>
<zip>95110</zip>
<website>http://www.adobe.com</website>
<phone>555-536-6000</phone>
</company>
</companies>
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.