Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.adigroup;
- import java.util.ArrayList;
- import org.xml.sax.Attributes;
- import org.xml.sax.SAXException;
- import org.xml.sax.helpers.DefaultHandler;
- import android.util.Log;
- public class MyXMLHandler extends DefaultHandler {
- Boolean currentElement = false;
- String currentValue = null;
- private static String _currenTag = null;
- private MallInfo _service;
- public MyXMLHandler()
- {
- LogScreen1._mallInfo = new ArrayList<MallInfo>();
- }
- /** Called when tag starts ( ex:- <name>AndroidPeople</name>
- * -- <name> )*/
- @Override
- public void startElement(String uri, String localName, String qName,
- Attributes attributes) throws SAXException {
- _currenTag = localName;
- if (localName.equals("NewDataSet"))
- {
- Log.d("Event_providers is -------------->>>>>>>>>>>>>>>>>>>>>>","" );
- _service = new MallInfo();
- }
- if (localName.equals("EVENT_ID"))
- {
- _service = new MallInfo();
- }
- }
- /** Called when tag closing ( ex:- <name>AndroidPeople</name>
- * -- </name> )*/
- @Override
- public void endElement(String uri, String localName, String qName)throws SAXException {
- if(localName.equalsIgnoreCase("Table"))
- {
- LogScreen1._mallInfo.add(_service);
- Log.d("sizeeeeeeeeeeeeeee","sizeeeeeeeeeeeeee " +LogScreen1._mallInfo .size() );
- }
- if(localName.equalsIgnoreCase("EVENT_ID"))
- {
- _service.EVENT_ID = currentValue;
- }
- if(localName.equalsIgnoreCase("EVNT_START_DATE"))
- {
- _service.EVNT_START_DATE = currentValue;
- }
- if(localName.equalsIgnoreCase("LOCATION"))
- {
- _service.LOCATION = currentValue;
- }
- }
- /** Called to get tag characters ( ex:- <name>AndroidPeople</name>
- * -- to get AndroidPeople Character ) */
- @Override
- public void characters(char[] ch, int start, int length)throws SAXException {
- Log.d("Values","***** " +_currenTag);
- if(_currenTag.equalsIgnoreCase("Table")){
- currentValue = new String(ch, start, length);
- Log.d("event_provider is--->>","loginnnnnnnnnnnnnn" + currentValue);
- }
- if(_currenTag.equalsIgnoreCase("EVENT_ID"))
- {
- currentValue = new String(ch, start, length);
- Log.d("Country is--->>","" + _service.Country);
- }
- if(_currenTag.equalsIgnoreCase("EVNT_START_DATE"))
- {
- currentValue = new String(ch, start, length);
- Log.d("EVNT_START_DATE is--->>","" + _service.EVNT_START_DATE);
- }
- if(_currenTag.equalsIgnoreCase("LOCATION"))
- {
- currentValue = new String(ch, start, length);
- Log.d("LOCATION is--->>","" + _service.LOCATION);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement