"NSMapTable {\n[1] Last -> 03:37:14\n[2] Ask -> 1.22961\n[3] High -> 1.2365\n[9] Attributes -> (read only map) {\n Symbol = GBPUSD;\n}\n[10] Bid -> 1.22928\n[12] Low -> 1.22886\n[15] Direction -> -1\n}\n",
With :
B4X:
For Each item As Map In m2
Dim title As String = item.Get("Bid")
Dim link As String = item.Get("Ask")
Next
I can get bid and ask values but i cant get the symbol value. Symbol is different from other it has a = instead of ->
How can i get the Symbol value here ?
I use this code to get bid and ask but i cant get the symbol
B4X:
Dim xm As Xml2Map
xm.Initialize
ParsedData = xm.Parse(File.ReadString(File.DirTemp, "ratesxml2.xml"))
'Log(ParsedData)
Dim m1 As Map = ParsedData.Get("Rates")
LogColor(m1,Colors.blue)
Dim m2 As List
m2 = m1.Get("Rate")
Log(m2)
For Each item As Map In m2
Dim title As String = item.Get("Bid")
Dim link As String = item.Get("Ask")
Log(title & link)
Next
I had missed the part that there is an attributes map inside it so i changed the code to:
B4X:
For Each item As Map In m2
Dim title As String = item.Get("Bid")
Dim link As Map = item.Get("Attributes")
Dim sik As String = link.Get("Symbol")
Log(title & sik)
Next