Sample code for 30+ languages & platforms
B4X

Load XML from a Remote URL

Demonstrates how to load XML from a remote URL, such as https://www.chilkatsoft.com/hamlet.xml

Chilkat B4X Downloads

B4X
Dim success As Boolean = False

'  This example assumes the Chilkat HTTP API to have been previously unlocked.
'  See Global Unlock Sample for sample code.

Dim http As ChilkatHttp
http.Initialize("http")
Dim sbXml As ChilkatStringBuilder
sbXml.Initialize

'  Download the XML from the URL into sbXml
success = http.QuickGetSb("https://www.chilkatsoft.com/hamlet.xml", sbXml)
If success = False Then
    Log(http.LastErrorText)
    Return
End If


Dim xml As ChilkatXml
xml.Initialize

'  Load the XML contained in sbXml
success = xml.LoadSb(sbXml, True)
If success = False Then
    Log(xml.LastErrorText)
    Return
End If


Log("Success.")