2010-11-26 74 views
0
<?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數據的字符串的方法?解析存儲爲字符串的xml數據

我想既然你有一個非常小的XML解析它能夠更好地在這裏使用dom parser得到結果成功

回答

1

這是一個SOAP響應,你可能會想嘗試這個庫:http://ksoap2.sourceforge.net/

它聲稱對小/有限的環境中,如手機是有用的。

如果你可以使用它那麼就沒有必要寫在SAX,DOM,Xmlpull等等等等另一個解析器