while (eventType != XmlPullParser.END_DOCUMENT ) {
if (eventType == XmlPullParser.START_TAG) {
tagname = xpp.getName();
} else if (eventType == XmlPullParser.TEXT) {
if (tagname.equals( "title" )) {
title += xpp.getText();
}
else if (tagname.equals( "description" )) {
desc += xpp.getText();
}
else if (tagname.equals( "author" )){
author += xpp.getText();
}
else if (eventType == XmlPullParser.END_TAG) {
tagname = xpp.getName();
if (tagname.equals( "item" )) {
titlevec.add(title);
descvec.add(desc);
authorvec.add(author);
title= "" ;
desc= "" ;
author= "" ;
}
}
}
|
안녕하세요 xmlpullparser를 이용해 파싱을 하고있습니다.
<item>
<title> 1~~~ </title>
<author>2 ~~~ </author>
<description>
<table>
3~~~~~~~~~~
</table>
4~~~~~~~~~~
</description>
</item>
위와같은 구조의 xml인데요
title이나 author description 안의 text는 잘 나옵니다.
헌데 description 안의 table 안의 text (3~~~~~~~) 를 뽑아내고싶은데 어떤식으로 해야할지 감이안옵니다 ㅠ_ㅠ
부탁드립니다 ㅠㅠ