Hi, Erel or any profi,
Please, suggest how to parse such text.
As string all is downloaded correct, but Sub Parser_EndElement returns only parent NAMEs, but TEXT is always empty, how to get fields with quoted values ?:
Please, suggest how to parse such text.
B4X:
Dim tr As TextReader
tr.Initialize2(HttpUtils.GetInputStream(Url),"UTF8")
Try
XML.Parse2(tr, "Parser")
As string all is downloaded correct, but Sub Parser_EndElement returns only parent NAMEs, but TEXT is always empty, how to get fields with quoted values ?:
B4X:
<answer>
<error/>
<result>
<root>
<server time="2012-05-21 11:35:07 +0000"/>
<managers>
<manager name="Bedroom" desc="" id="382" type="1" eip="85.236.174.66"iip="192.168.1.111" mac="88-B6-27-01-00-01" lts="2011-12-15 10:19:24 +0000">
<socket name="Socket1" s="0"/>
<socket name="Socket2" s="1"/>
<socket name="Socket3" s="1"/>
<socket name="Socket4" s="0"/>
</manager>
<manager name="Device4" desc="" id="520" type="2" eip="112.95.145.165"iip="192.168.16.102" mac="00-11-F6-8B-D2-A7" lts="2011-12-16 03:54:21 +0000">
<socket name="Socket1" s="1"/>
<socket name="Socket2" s="0"/>
<socket name="Socket3" s="0"/>
<socket name="Socket4" s="0"/>
</manager>
<manager name="Device5" desc="" id="524" type="2" eip="112.95.145.165"iip="192.168.1.100" mac="00-11-F6-8B-D2-A6" lts="2011-12-14 09:37:46 +0000">
<socket name="Socket1" s="0"/>
<socket name="Socket2" s="1"/>
<socket name="Socket3" s="1"/>
<socket name="Socket4" s="1"/>
</manager>
<manager name="Device5" desc="" id="533" type="1" eip="112.95.145.165"iip="192.168.1.108" mac="88-B6-27-01-00-10" lts="2011-12-19 03:44:20 +0000">
<socket name="Socket1" s="0"/>
<socket name="Socket2" s="0"/>
<socket name="Socket3" s="1"/>
<socket name="Socket4" s="1"/>
</manager>
</managers>
<meters>
<meter name="Television" desc="" id="54" type="3" eip="85.236.174.66"iip="192.168.1.107" mac="88-B6-27-01-00-05" lts="2012-05-17 12:14:29 +0000"/>
<meter name="Device6" desc="" id="601" type="3" eip="82.148.198.99"iip="192.168.2.51" mac="88-B6-27-01-00-11" lts="2012-05-12 07:33:43 +0000">
<measure name="Power" v="0"/>
<measure name="Energy (Day)" v="10.1605224609375"/>
<measure name="Energy (Night)" v="0"/>
</meter>
</meters>
</root>
</result>
</answer>