java - Default Handler - fetch tag name -
i implementing default handler in android. xml doc looks -
<item> <rating>1</rating> <num>20</num> </item>
i overriding characters method fetch tag values rating , num tags.
public void characters(char ch[], int start, int length) { string value = new string(ch,start,length); }
but how can check if value belongs rating or num tag ?
example if string 'value' gets value (10 or b) how fetch tagname ie (rating or num) ?
thanks
string startname; public void startelement(string uri, string localname, string qname, attributes attributes) throws saxexception { startname=qname; } public void characters(char ch[], int start, int length) { //here check startname is.it can rating or num string value = new string(ch,start,length); }
Comments
Post a Comment