Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3/4 Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(Tcl) SearchAllForContentDemonstrates some ways to iterate over direct child nodes by index. The input XML, available at http://www.chilkatsoft.com/data/get_child.xml, is this: <root> <fruit color="red">apple</fruit> <fruit color="green">pear</fruit> <veg color="orange">carrot</veg> <meat animal="cow">beef</meat> <xyz> <fruit color="blue">blueberry</fruit> <veg color="green">broccoli</veg> </xyz> <fruit color="purple">grape</fruit> <cheese color="yellow">cheddar</cheese> </root>
load ./chilkat.dll set xml [new_CkXml] # xBeginAfter is a CkXml # xFound is a CkXml # The sample input XML is available at http://www.chilkatsoft.com/data/search1.xml set success [CkXml_LoadXmlFile $xml "search1.xml"] if {[expr $success != 1]} then { puts [CkXml_lastErrorText $xml] delete_CkXml $xml exit } set xBeginAfter [CkXml_GetSelf $xml] set xFound [CkXml_SearchAllForContent $xml $xBeginAfter "*croc*"] while {![string equal $xFound "NULL"]} { puts [CkXml_tag $xFound] delete_CkXml $xBeginAfter set xBeginAfter $xFound set xFound [CkXml_SearchAllForContent $xml $xBeginAfter "*croc*"] } delete_CkXml $xBeginAfter delete_CkXml $xml |
© 2000-2016 Chilkat Software, Inc. All Rights Reserved.