Hello
I use the saxparser
my xml file
my code for test
the Parser_StartElement is called.
the parameters attributes works
but the parameter Name is always empty. Why
thank
I use the saxparser
my xml file
B4X:
<?xml version="1.0" encoding="UTF-8"?>
<intallation>
<cabinet name="Labo 1" ctrl1="2.168.0.11" ctrl2="2.168.0.12">1</cabinet>
<cabinet name="Labo 2" ctrl1="2.168.0.21" ctrl2="2.168.0.22">2</cabinet>
<cabinet name="TST" ctrl1="2.168.1.11" ctrl2="2.168.1.12">3</cabinet>
<cabinet name="office 1" ctrl1="2.168.2.11" ctrl2="2.168.2.12">4</cabinet>
<cabinet name="office 2" ctrl1="2.168.2.21" ctrl2="2.168.2.22">5</cabinet>
<cabinet name="office 3" ctrl1="2.168.2.31" ctrl2="2.168.2.32">6</cabinet>
</intallation>
my code for test
B4X:
Sub Parser_StartElement (Uri As String, Name As String, Attributes As Attributes)
If xml.Parents.IndexOf("item") > -1 Then
If Name = "installation" Then
Log ("Installation")
Else If Name = "cabinet" Then
Log ("cabinet")
Else If Name = "ctrl" Then
Log ("ctrl")
End If
End If
End Sub
Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
If xml.Parents.IndexOf("item") > -1 Then
If Name = "installation" Then
Log ("Installation")
Else If Name = "cabinet" Then
Log ("cabinet")
Else If Name = "ctrl" Then
Log ("ctrl")
End If
End If
End Sub
the Parser_StartElement is called.
the parameters attributes works
but the parameter Name is always empty. Why
thank