各位,目前我们项目中有一个 获取XML中的
<latlng>45.515917,-122.674833</latlng>
其中45.515917,-122.674833是我们工作人员的纬度和经度。
而服务器地址是 35.515917,-122.674833我在android中能够获取到xml但是解析的时候总是出问题
因此,我把XML贴上来,求大虾帮我解析下XML,哈哈,最好
能将我服务器的地址,和解析到工作人员的地址对比下,
弹出离服务器最近的工作人员地址。谢谢!<sites>
<copyright>
Copyright ? 2002-2011 Thomas W. Dowling. All rights reserved. For more info, contact [email protected] or call 916-988-3459.
</copyright>
<freshness> 1/30/2011 11:43:02 PM PT </freshness><site>
<id>97204_1</id>
<name>Downtown Portland</name>
<latlng>45.515917,-122.674833</latlng>
<status>Up</status>
<action>OK</action>
<pay>no</pay>
<restricted>no</restricted>
<address>SW Salmon St. at SW 1st Ave.</address>
<city>aos, Portland, OR</city>
<county>Multnomah</county>
<othercond number="2" up="2"/>
</site><site>
<id>94501_4</id>
<name>Alameda City Parking Lot</name>
<latlng>37.76843,-122.24595</latlng>
<status>Up</status>
<action>OK</action>
<pay>no</pay>
<restricted>yes</restricted>
<address>Lincoln Ave. at Walnut Ave</address>
<city>bay, Alameda, CA</city>
<county>Alameda</county>
<avc number="4" up="4"/>
</site><site>
<id>94501_1</id>
<name>Bank of Alameda</name>
<latlng>37.76014,-122.2518</latlng>
<status>Down</status>
<action>DOWN LOC</action>
<pay>no</pay>
<restricted>no</restricted>
<address>2130 Otis Drive</address>
<city>bay, Alameda, CA</city>
<county>Alameda</county>
<lpi number="1" down="1"/>
<avc number="1" down="1"/>
</site><site>
<id>92311_1</id>
<name>Barstow Station</name>
<latlng>34.891320,-116.999312</latlng>
<status>Up</status>
<action>NEW LOC</action>
<pay>no</pay>
<restricted>no</restricted>
<address>1611 E. Main St.</address>
<city>sbo, Barstow, CA</city>
<county>San Bernardino</county>
<othercond number="1" up="1"/>
<tsl number="1" up="1"/>
</site>
</sites>
<latlng>45.515917,-122.674833</latlng>
其中45.515917,-122.674833是我们工作人员的纬度和经度。
而服务器地址是 35.515917,-122.674833我在android中能够获取到xml但是解析的时候总是出问题
因此,我把XML贴上来,求大虾帮我解析下XML,哈哈,最好
能将我服务器的地址,和解析到工作人员的地址对比下,
弹出离服务器最近的工作人员地址。谢谢!<sites>
<copyright>
Copyright ? 2002-2011 Thomas W. Dowling. All rights reserved. For more info, contact [email protected] or call 916-988-3459.
</copyright>
<freshness> 1/30/2011 11:43:02 PM PT </freshness><site>
<id>97204_1</id>
<name>Downtown Portland</name>
<latlng>45.515917,-122.674833</latlng>
<status>Up</status>
<action>OK</action>
<pay>no</pay>
<restricted>no</restricted>
<address>SW Salmon St. at SW 1st Ave.</address>
<city>aos, Portland, OR</city>
<county>Multnomah</county>
<othercond number="2" up="2"/>
</site><site>
<id>94501_4</id>
<name>Alameda City Parking Lot</name>
<latlng>37.76843,-122.24595</latlng>
<status>Up</status>
<action>OK</action>
<pay>no</pay>
<restricted>yes</restricted>
<address>Lincoln Ave. at Walnut Ave</address>
<city>bay, Alameda, CA</city>
<county>Alameda</county>
<avc number="4" up="4"/>
</site><site>
<id>94501_1</id>
<name>Bank of Alameda</name>
<latlng>37.76014,-122.2518</latlng>
<status>Down</status>
<action>DOWN LOC</action>
<pay>no</pay>
<restricted>no</restricted>
<address>2130 Otis Drive</address>
<city>bay, Alameda, CA</city>
<county>Alameda</county>
<lpi number="1" down="1"/>
<avc number="1" down="1"/>
</site><site>
<id>92311_1</id>
<name>Barstow Station</name>
<latlng>34.891320,-116.999312</latlng>
<status>Up</status>
<action>NEW LOC</action>
<pay>no</pay>
<restricted>no</restricted>
<address>1611 E. Main St.</address>
<city>sbo, Barstow, CA</city>
<county>San Bernardino</county>
<othercond number="1" up="1"/>
<tsl number="1" up="1"/>
</site>
</sites>
[email protected]
貌似是,实现接口的那个类(方法)出错
我现在贴出来源代码连接..我实在是找不出错误的地方了,各位有兴趣的可以下到自己电脑内,跑一下.
注:页面上就加了一个 button 各位大侠可以自己在本地加上去,我用的是第三种方法
pullxml方法......http://blog.csdn.net/liuhe688/article/details/6415593
大侠调通了,把demo发到我的邮件,谢谢
[email protected]
<sites>
<copyright>
Copyright ? 2002-2011 Thomas W. Dowling. All rights reserved. For more info, contact [email protected] or call 916-988-3459.
</copyright>
<freshness> 1/30/2011 11:43:02 PM PT </freshness><site>
<id>97204_1</id>
<name>Downtown Portland</name>
<latlng>45.515917,-122.674833</latlng>
<status>Up</status>
<action>OK</action>
<pay>no</pay>
<restricted>no</restricted>
<address>SW Salmon St. at SW 1st Ave.</address>
<city>aos, Portland, OR</city>
<county>Multnomah</county>
<othercond number="2" up="2"/>
</site><site>
<id>94501_4</id>
<name>Alameda City Parking Lot</name>
<latlng>37.76843,-122.24595</latlng>
<status>Up</status>
<action>OK</action>
<pay>no</pay>
<restricted>yes</restricted>
<address>Lincoln Ave. at Walnut Ave</address>
<city>bay, Alameda, CA</city>
<county>Alameda</county>
<avc number="4" up="4"/>
</site><site>
<id>94501_1</id>
<name>Bank of Alameda</name>
<latlng>37.76014,-122.2518</latlng>
<status>Down</status>
<action>DOWN LOC</action>
<pay>no</pay>
<restricted>no</restricted>
<address>2130 Otis Drive</address>
<city>bay, Alameda, CA</city>
<county>Alameda</county>
<lpi number="1" down="1"/>
<avc number="1" down="1"/>
</site><site>
<id>92311_1</id>
<name>Barstow Station</name>
<latlng>34.891320,-116.999312</latlng>
<status>Up</status>
<action>NEW LOC</action>
<pay>no</pay>
<restricted>no</restricted>
<address>1611 E. Main St.</address>
<city>sbo, Barstow, CA</city>
<county>San Bernardino</county>
<othercond number="1" up="1"/>
<tsl number="1" up="1"/>
</site>
</sites>