Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Delphi DLL) Xml.ChildContent Example #2Another Xml.UpdateChildContent example...
uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, StringBuilder, Xml; ... procedure TForm1.Button1Click(Sender: TObject); var xml: HCkXml; sbValue: HCkStringBuilder; i: Integer; begin xml := CkXml_Create(); CkXml_putTag(xml,'abc'); sbValue := CkStringBuilder_Create(); i := 0; while i < 10 do begin CkXml_putI(xml,i); CkStringBuilder_Clear(sbValue); CkStringBuilder_AppendInt(sbValue,i); CkXml_UpdateChildContent(xml,'xyz|test[i]',CkStringBuilder__getAsString(sbValue)); i := i + 1; end; Memo1.Lines.Add(CkXml__getXml(xml)); // Output is: // <?xml version="1.0" encoding="utf-8" ?> // <abc> // <xyz> // <test>0</test> // <test>1</test> // <test>2</test> // <test>3</test> // <test>4</test> // <test>5</test> // <test>6</test> // <test>7</test> // <test>8</test> // <test>9</test> // </xyz> // </abc> CkXml_Dispose(xml); CkStringBuilder_Dispose(sbValue); end; |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.