我有xml解析以下内容。Android:解析标签包含android内容中的html内容
<body>
<body.content>
<p>This is testing content.</p>
<p>This is testing content.This is testing content.This is testing content.This is testing content.This is testing content.This is testing content.This is testing content.This is testing content.This is testing content.This is testing content.</p>
</body.content>
</body>
我有这个XML的解析器方法。
bodyTag.getChild(body_content).setEndTextElementListener(new EndTextElementListener() {
@Override
public void end(String body) {
System.out.println(body);
}
});
我的问题是当我解析这个XML我得到了下面的异常。
10-06 15:39:21.976:E/AndroidRuntime(1110): 了java.lang.RuntimeException:android.sax.BadXmlException:致线86:命名为文本元素内 遇到混合内容' body.content”。
问题是sax解析器无法解析html <p>
标记。 我想知道有什么方法可以通过sax解析器来解析html content
。
感谢
jsoup用于解析html标记。是吗?我的要求是解析xml标签中包含的html上下文。 – user1156041