Hi,
I have having a small issue trying to read a XML file.
My XML looks like this:
and I am trying to read the value 'Available' from the AccountResult tag.
I have tried using the Xml2Map from: https://www.b4x.com/android/forum/t...ple-way-to-parse-xml-documents.74848/#content
The code I have tried is:
However, it seems to return null
Any ideas on where I have gone wrong ?
I have having a small issue trying to read a XML file.
My XML looks like this:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><ResponseHeader xmlns="https://192.168.0.99/API"><Text>OK</Text></ResponseHeader></soap:Header><soap:Body><AccountResponse xmlns="https://192.168.0.99/API"><AccountResult>Available</AccountResult></AccountResponse></soap:Body></soap:Envelope>
and I am trying to read the value 'Available' from the AccountResult tag.
I have tried using the Xml2Map from: https://www.b4x.com/android/forum/t...ple-way-to-parse-xml-documents.74848/#content
The code I have tried is:
B4X:
Sub CheckAccount
Dim xm As xml2map
xm.Initialize
Dim XML_value As String = $"<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><ResponseHeader xmlns="https://192.168.0.99/API"><Text>OK</Text></ResponseHeader></soap:Header><soap:Body><AccountResponse xmlns="https://192.168.0.99/API"><AccountResult>Available</AccountResult></AccountResponse></soap:Body></soap:Envelope>"$
Dim phrasedata As Map
phrasedata = xm.Parse(XML_value)
Log(phrasedata.get("AccountResult"))
End Sub
However, it seems to return null
Any ideas on where I have gone wrong ?