【发布时间】:2012-09-25 03:55:28
【问题描述】:
我试图读取服务 url,它是 xml 格式的。当我试图解析这个 xml 时,我得到了这个错误:我搜索了这个,xml 起始标头标记的问题,即 .
我的 xml 从 logcat 输出:
09-25 09:09:37.134: I/System.out(408): <?xml version="1.0" encoding="UTF-8"?>
09-25 09:09:37.144: I/System.out(408): <ad2app>
09-25 09:09:37.144: I/System.out(408): <mob_interstitial>
09-25 09:09:37.154: I/System.out(408): <size>
09-25 09:09:37.154: I/System.out(408): <dimension>pixel</dimension>
09-25 09:09:37.154: I/System.out(408): <width>320</width>
09-25 09:09:37.154: I/System.out(408): <height>416</height>
09-25 09:09:37.154: I/System.out(408): </size>
09-25 09:09:37.154: I/System.out(408): <duration>
09-25 09:09:37.154: I/System.out(408): <dimension>seconds</dimension>
09-25 09:09:37.154: I/System.out(408): <d_number>5</d_number>
09-25 09:09:37.154: I/System.out(408): </duration>
从上面输出,添加了不必要的符号。像这样:<?xml version="1.0" encoding="UTF-8"?>
现在,我怎样才能从我的 xml 中删除不必要的符号来解决这个问题。 有什么帮助...??
【问题讨论】:
标签: android dom xml-parsing