Dim oList As List
oList.Initialize
Dim In As InputStream
In = File.OpenInput(File.DirAssets, "xml_fh378692.xml")
parser.Parse(In, "Parser")
For i=0 To oList.Size-1
Log(oList.Get(i))
Next
Sub Parser_StartElement (Uri As String, Name As String, Attributes As Map)
Dim sElement_Name As String
Dim sPixelTop As String
Dim sPixelLeft As String
If Name="node" Then
sElement_Name=Attributes.Get("element_name")
sPixelTop=Attributes.Get("pixelTop")
sPixelLeft=Attributes.Get("pixelLeft")
oList.Add(sElement_Name & " top:" & sPixelTop & " left:" & sPixelLeft)
End If
End Sub
I can see the attributes as the parser walks down the xml structure.
I don't understand why Text displays the same value when the node structure is nested.
[code]
Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
If parser.Parents.IndexOf("node") =1 Then
If Name = "node" Then
Log(Text.ToString)
EndIf
EndIf
End Sub