android - Parse XML with XmlPullParser -


i have xml file one:

<?xml version="1.0" encoding="utf-8"?> <training>     <lesson name="set_01">         <exercise>             <param controller="training01"/>             <param form="training01"/>             <param table="voctrain"/>             <param subset="0,62"/>             <param template="clicks"/>             <param description="0101_0"/>         </exercise>         <exercise>             <param controller="training02"/>             <param form="training02"/>             <param table="voctrain"/>             <param subset="0,62"/>             <param template="clicks"/>             <param description="0101_1"/>             <param sound="n"/>             <param mode="de"/>             <param count="80"/>         </exercise>         <exercise>             ...         </exercise>         <exercise>         ...         </exercise>     </lesson>     <lesson name="set_02">         <exercise>         ...         </exercise>         <exercise>         ...         </exercise>         <exercise>         ...         </exercise>     </lesson> </training> 

with xmlpullparser can find tags training , lesson, lesson need containing name. want collect exercise parameters named lesson i.e. "set_01". within exercise there parameters param count="80". here need within param ... />. how obtain it?

try code in parser switch:

case xmlpullparser.end_tag:   string tag=parser.getname();   if(tag.equals("lesson")){      string name=parser.getattributevalue(null,"name");      ...   } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -