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
(PureBasic) Load XML from a Remote URLDemonstrates how to load XML from a remote URL, such as https://www.chilkatsoft.com/hamlet.xml
IncludeFile "CkHttp.pb" IncludeFile "CkStringBuilder.pb" IncludeFile "CkXml.pb" Procedure ChilkatExample() ; This example assumes the Chilkat HTTP API to have been previously unlocked. ; See Global Unlock Sample for sample code. http.i = CkHttp::ckCreate() If http.i = 0 Debug "Failed to create object." ProcedureReturn EndIf sbXml.i = CkStringBuilder::ckCreate() If sbXml.i = 0 Debug "Failed to create object." ProcedureReturn EndIf ; Download the XML from the URL into sbXml success.i = CkHttp::ckQuickGetSb(http,"https://www.chilkatsoft.com/hamlet.xml",sbXml) If success = 0 Debug CkHttp::ckLastErrorText(http) CkHttp::ckDispose(http) CkStringBuilder::ckDispose(sbXml) ProcedureReturn EndIf xml.i = CkXml::ckCreate() If xml.i = 0 Debug "Failed to create object." ProcedureReturn EndIf ; Load the XML contained in sbXml success = CkXml::ckLoadSb(xml,sbXml,1) If success = 0 Debug CkXml::ckLastErrorText(xml) CkHttp::ckDispose(http) CkStringBuilder::ckDispose(sbXml) CkXml::ckDispose(xml) ProcedureReturn EndIf Debug "Success." CkHttp::ckDispose(http) CkStringBuilder::ckDispose(sbXml) CkXml::ckDispose(xml) ProcedureReturn EndProcedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.