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
Sort XML Records
C# sample code showing how to sort records in an XML document private void SortCompanies_Click(object sender, System.EventArgs e)
{
Chilkat.Xml xml = new Chilkat.Xml();
xml.LoadXmlFile("companies.xml");
// Sort the company records by name.
bool ascending = true;
xml.SortRecordsByContent("name",ascending);
// Sort the fields within each company record by the field name.
bool b = xml.FirstChild2();
while (b)
{
xml.SortByTag(ascending);
b = xml.NextSibling2();
}
xml.GetRoot2();
xml.SaveXml("sortedByName.xml");
}
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.