我有一个从xml接收数据的应用程序&将它们解析为app。但是在输出中有加法字符(xml标记)。

我该怎么办?
public final String getElementValue2( Node elem ) {
Node child;
if( elem != null){
if (elem.hasChildNodes()){
for( child = elem.getFirstChild(); child != null; child = child.getNextSibling() )
{
if(child.getNodeType() == Node.CDATA_SECTION_NODE)
{
CDATASection cdata = (CDATASection)child;
cda =cdata.getData().toString();
}
}
}
}
return "";XML http://news.tebiran24.com/feed/
发布于 2013-09-21 13:16:48
XML似乎会向您的数据发送额外的链接。只要从响应中删除不需要的数据,您就会得到您想要的答案。
这方面的代码是:
// I am guessing `cda` is the response you got from the feed which contains the additional characters.
String[] data = cda.split("a>");
cda=data[1];现在打印cda。不会有任何额外的角色。
https://stackoverflow.com/questions/18932984
复制相似问题