I have to display cat_name in listview and when i click any name it will display it’s cat_description. my url is http://mobileecommerce.site247365.com/admin/catdata.xml
I can able to display name in listview.My problem is i parse whole cat_desc but i want particular cat_desc according to cat_name.if any one have an idea for this?
I use
if(currenttag.equals("Cat_Desc"))
sitesList.setCat_Desc(String.valueOf(ch,start,length));
For set cat_desc. but it will set all cat_desc but i want specific cat_desc.
When i fetching cat_desc i use sitelist.getcatdesc().size().It will show me approximately 4500.
If any one having any solution or give me solution for this.
My Handler-
public void startElement(String uri, String localName, String qName,Attributes attributes) throws SAXException
{
currenttag=localName;
if(currenttag.equals("NewDataSet")) {
currentElement =true;
sitesList = new SitesList();
}
}
public void endElement(String uri, String localName, String qName)throws SAXException
{
super.endElement(uri, localName, qName);
if(qName.equals("NewDataSet"))
{
currentElement = false;
}
}
public void characters(char[] ch, int start, int length)throws SAXException
{
if(currenttag.equals("Cat_Name"))
sitesList.setCat_Name(String.valueOf(ch,start,length));
else if(currenttag.equals("Cat_Desc"))
sitesList.setCat_Desc(String.valueOf(ch,start,length));
java class–
for (int i = 0; i less than sitesList.getCat_Name().size(); i++)
catNames[i]=sitesList.getCat_Name().get(i);
for(int j=0; j less than sitesList.getCat_Desc().size();j++)
catdesc[j]=sitesList.getCat_Desc().get(j);
Thanks and Regards
Arpit
If I’m understanding you correctly, you can modify this code:
To this
Where specialDescription is a field (instance variable) in your SaxParser class.