【问题标题】:Parse xml data which is stored as string解析存储为字符串的 xml 数据
【发布时间】:2023-03-06 14:32:01
【问题描述】:
    <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><loginResponse xmlns="https://comm1.get.com/"><loginResult>true</loginResult><result>success</result></loginResponse></soap:Body></soap:Envelope>

有没有办法解析包含 xml 数据的字符串?

我想得到结果成功

【问题讨论】:

    标签: android string xml-parsing


    【解决方案1】:

    这是一个 SOAP 响应,您可能想试试这个库:http://ksoap2.sourceforge.net/

    它声称对手机等小型/有限环境很有用。

    如果你可以使用它,那么就不需要在 SAX、DOM、Xmlpull 等中编写另一个解析器。

    【讨论】:

      【解决方案2】:

      因为你有一个非常小的 xml 来解析它更好地使用 dom parser 这里。
      另请参阅SAXParser

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-01-26
        • 1970-01-01
        • 2011-06-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多