通过SAXParser解析xml包含html标记
问题描述:
我从xml解析包含html标记的数据。 我无法获取图像的src属性,任何人都可以显示此链接。 http://mobileecommerce.site247365.com/admin/catdata.xml 我给你的网址这并不意味着我想显示你的整个代码。我的意思是给一些链接或一些想法。通过SAXParser解析xml包含html标记
在此先感谢
Arpit
答
String str = "Your Cat_Desc tag value";
String[] temp;
if (str.contains("<img src=")) {
temp = str.split("<img src=");
String imagesUrl = temp[1].substring(
temp[1].indexOf("\""), temp[1]
.indexOf(" "));
imagesUrl = imagesUrl
.replace("\"", " ");
System.out.println("My image URL :: " +imagesUrl);
}else {
System.out.println("NO imageurl found"); }
感谢答复divyesh.i将执行它,然后我抓住你。 – user988853
我用你的网址和你的Cat_Desc标签值进行检查.........对我来说工作很好............... –