[英]Index element using setter getter android
這是我的jsoup解析器,用於提取肥皂含量
doc = Jsoup.parse(getxml,"", Parser.xmlParser());
Elements taux = doc.select("taux");
Elements devise = doc.select("devise");
Elements datecours = doc.select("dateCours");
Elements libelle = doc.select("libelle");
Elements quotite = doc.select("quotite");
Elements fixing = doc.select("fixing");
也許這會對您有所幫助。 從Web服務獲取元素之后,假設所有字符串都包含一個帶有單獨值的大字符串,請執行以下操作:
String[] deviseSeparated = devise.split(" ");
String[] datecourSeparated = datecour.split(" ");
String[] libelSeparated = libel.split(" ");
String[] quotSeparated = quot.split(" ");
String[] fixSeparated = fix.split(" ");
然后,假設所有數組的大小相同,只需執行此for循環即可初始化對象:
for (int i = 0; i < deviseSeparated.length; i++) {
PostList.add(new convertor_pst(deviseSeparated[i],datecourSeparated[i],libelSeparated[i],quotSeparated[i],fixSeparated[i]));
}
這是你想要的?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.