안드로이드 개발 질문/답변
(글 수 358)
<entymd>2011-12-07 13:51:39.001</entymd>
<upymd>2011-12-07 13:51:39.001</upymd>
<choicesid>CI00007983</choicesid>
<choicesname>栄養ラインと輸液ラインの誤接続(厳禁)について</choicesname>
<dispor>1</dispor>
<freeinputflg>0</freeinputflg>
<correctflg>0</correctflg>
<delflg>0</delflg>
</choices>
<entymd>2011-12-07 13:51:39.008</entymd>
<upymd>2011-12-07 13:51:39.008</upymd>
<choicesid>CI00007984</choicesid>
<choicesname>濃厚流動食への他の物質の混合による変化について</choicesname>
<dispor>2</dispor>
<freeinputflg>0</freeinputflg>
<correctflg>0</correctflg>
<delflg>0</delflg>
</choices>
위와 같은 xml을 pullparser을 이용하요 파싱하는데 우선 위의 <choice>부분과 아래 <choice>부분을 나누어 arraylist에 저장한 후
<choicesname>부분만 따로 빼내어 나중에 따로따로 빼서 쓰려고 하는데 어떻게 해야 하는지 감이 안옵니다.
startTAG
if (tag.equalsIgnoreCase("choices")) {
quesde = new questiondetail();
if (quesde.choicesList == null) {
quesde.choicesList = new ArrayList<choices>();//choice요소를 담는 배열
}
if (tag.equalsIgnoreCase("choicesname")) {
cho = new choices();
cho.choicesname = parser.nextText();//choice배열 중 choicesname 을 구하기위한 부분
cho = new choices();
cho.choicesname = parser.nextText();//choice배열 중 choicesname 을 구하기위한 부분
endTAG
if (tag.compareTo("choices") == 0) {
questionList = new QuestionList();
questionList = new QuestionList();
quesde=new questiondetail();
quesde.choicesList.add(cho); //나중에 arraylist에 배열 번호를 통해 빼내려합니다.
quesde.choicesList.add(cho); //나중에 arraylist에 배열 번호를 통해 빼내려합니다.
}
전혀 안되는데 누가 아시면 가르쳐주세요