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
(DataFlex) Xml.UpdateAttrAt Example #2Another Xml.UpdateAttrAt example...
Use ChilkatAx-win32.pkg Procedure Test Handle hoXml Handle hoSbValue Integer i Boolean iSuccess String sTemp1 Get Create (RefClass(cComChilkatXml)) To hoXml If (Not(IsComObjectCreated(hoXml))) Begin Send CreateComObject of hoXml End Set ComTag Of hoXml To "abc" Get Create (RefClass(cComChilkatStringBuilder)) To hoSbValue If (Not(IsComObjectCreated(hoSbValue))) Begin Send CreateComObject of hoSbValue End Move 0 To i While (i < 10) Set ComI Of hoXml To i Send ComClear To hoSbValue Get ComAppendInt Of hoSbValue i To iSuccess Get ComGetAsString Of hoSbValue To sTemp1 Get ComUpdateAttrAt Of hoXml "xyz|test[i]" True "index" sTemp1 To iSuccess Move (i + 1) To i Loop Get ComGetXml Of hoXml To sTemp1 Showln sTemp1 // Output is: // <?xml version="1.0" encoding="utf-8" ?> // <abc> // <xyz> // <test index="0" /> // <test index="1" /> // <test index="2" /> // <test index="3" /> // <test index="4" /> // <test index="5" /> // <test index="6" /> // <test index="7" /> // <test index="8" /> // <test index="9" /> // </xyz> // </abc> End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.