Android Question Read XML file

jcmartini

Member
Licensed User
Longtime User
I wanted to read a simple xml file. I tried xmlsax with the following code:

Sub Parser_StartElement (Uri As String, Name As String, Attributes As Attributes)
Dim idx, Caption As String
'If Name = "Node" Then ' Begin @ idx=3
'If Name = "Items" Then ' Shows nothing
'If parser.Parents.IndexOf("Items") > -1 Then ' Begin @ idx=3
idx = Attributes.GetValue2("", "idx") ' Begin @ idx=1
Caption = Attributes.GetValue2("", "Caption")
ListView1.AddSingleLine(idx & " : " & Caption)
'End If
End Sub
Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
End Sub

I cannot see the first zero idx. How should I do to have that ?

Another question: Where could I find XmlSax version 10 ?


1790935665040.png
 

Attachments

  • pizzas_andr.xml
    1,004 bytes · Views: 3

Chris2

Well-Known Member
Licensed User
Longtime User
You should use CODE /CODE tags when posting code. It makes it much easier to read.

I realise that I'm not really answering your quesiton directly, but it might be easier for you to switch to Xml2Map:
 
Upvote 1
Top