在 Android 应用程序中使用 SAX 解析器进行 Xml 解析。

发布于 2024-09-24 18:08:47 字数 223 浏览 2 评论 0原文

任何人都可以解决我关于 XML SAX 解析的问题:

我有一个小问题,在我的 Android 应用程序中,当解析完成时,它会遍历整个响应并解析数据。

我的问题是我只想解析来自特定位置的数据。这样,当我解析 XML 响应时,应该从所需的位置进行解析,然后即使“相同的标记”曾经出现在响应中的其他位置,也不应该进一步检查。

有什么办法可以做到这一点吗?我严重陷入这种情况,不知道该怎么办。

Can anybody please solve my Issue regarding XML SAX Parsing:

I have a small issue that in my Android application when parsing is done, it goes through the whole response and parse the data.

My issue is that I just want to parse the data from the particular place. So that when I parse the XML Response, parsing should be done from the desired place and then it should not check further even if the "same tag" used to appear elsewhere in the response.

Is there any way to do this? I am stranded in this situation badly and have no clue for what to do.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

寂寞花火° 2024-10-01 18:08:47

尝试使用 xmlpullparser 而不是 SAX 解析器,Android 也支持 xmlpullparser

Try using xmlpullparser instead of SAX parser, Android supports xmlpullparser too

李不 2024-10-01 18:08:47

尝试重新启动 Eclipse 或您正在使用的框架。

Try restarting your Eclipse, or the framework you are using.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文