SAX parser raise some error
<p>I got some issue with parsing, when I PHP based web service. I got stuck still from 2 day. I can't get any output in Activity. When I print it in Handler I got successfully print variable.<br>
here are some logcate:                 </p>

<pre><code>02-08 00:51:04.889: WARN/System.err(606): org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 805: not well-formed (invalid token)
02-08 00:51:04.893: WARN/System.err(606):     at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:523)
02-08 00:51:04.893: WARN/System.err(606):     at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:482)
02-08 00:51:04.893: WARN/System.err(606):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:320)
02-08 00:51:04.893: WARN/System.err(606):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:277)
02-08 00:51:04.893: WARN/System.err(606):     at com.ESM.viewAllpartActivity.onCreate(viewAllpartActivity.java:69)
02-08 00:51:04.893: WARN/System.err(606):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-08 00:51:04.904: WARN/System.err(606):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-08 00:51:04.904: WARN/System.err(606):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-08 00:51:04.904: WARN/System.err(606):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-08 00:51:04.904: WARN/System.err(606):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-08 00:51:04.904: WARN/System.err(606):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-08 00:51:04.914: WARN/System.err(606):     at android.os.Looper.loop(Looper.java:123)
02-08 00:51:04.914: WARN/System.err(606):     at android.app.ActivityThread.main(ActivityThread.java:4627)
02-08 00:51:04.914: WARN/System.err(606):     at java.lang.reflect.Method.invokeNative(Native Method)
02-08 00:51:04.914: WARN/System.err(606):     at java.lang.reflect.Method.invoke(Method.java:521)
02-08 00:51:04.914: WARN/System.err(606):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-08 00:51:04.914: WARN/System.err(606):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-08 00:51:04.914: WARN/System.err(606):     at dalvik.system.NativeStart.main(Native Method)
</code></pre>

<p>when I have call xml parsing.</p>

<p><strong>here I have Past Code::-</strong> </p>

<pre><code>package com.awe;

import java.net.URL;
import java.util.ArrayList;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

public class viewAllpartActivity extends Activity implements
        OnItemClickListener {
    /** Called when the activity is first created. */
    /* declare widgets */

    String nickname;
    String type;
    boolean flag = true;
    ListView lview3;

    blog_list_adapter adapter;

    String[] str_blogImage;
    String[] str_blogtitle;
    String[] str_morelink;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.view_allparty);

        Button home_logout;
        final Intent homeintent;
        homeintent = new Intent(viewAllpartActivity.this, MainActivity.class);
        home_logout = (Button) findViewById(R.id.vap_logout);
        home_logout.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                startActivity(homeintent);
                finish();

            }
        });
        try {
            SAXParserFactory spf = SAXParserFactory.newInstance();
            SAXParser sp = spf.newSAXParser();
            XMLReader xr = sp.getXMLReader();

            /** Send URL to parse XML Tags */
            URL sourceUrl = new URL(
                    "URL?api=ViewBooking_Admin");

            /** Create handler to handle XML Tags ( extends DefaultHandler ) */
            viewAllPartyHandler myXMLHandler = new viewAllPartyHandler();
            xr.setContentHandler(myXMLHandler);
            xr.parse(new InputSource(sourceUrl.openStream()));

            viewAllPartydataset parsedLoginDataSet = myXMLHandler
                    .getParsedRegistrationData();
            ArrayList&lt;String&gt; Bookingid = myXMLHandler.getbooking_id();
            ArrayList&lt;String&gt; partyname = myXMLHandler.br3;
            System.out.println("partyname :::: : "+partyname);
            new xyz().execute();

        } catch (Exception e) {
        e.printStackTrace();
        }

    }

    private class xyz extends AsyncTask&lt;Void, Void, Void&gt; {
        private final ProgressDialog dialog = new ProgressDialog(
                viewAllpartActivity.this);

        @Override
        protected void onPreExecute() {
            this.dialog.setMessage("Please Wait...");
            this.dialog.show();
            this.dialog.setIndeterminate(true);

            // put your code which preload with processDialog
        }

        @Override
        protected Void doInBackground(Void... arg0) {
            // put your code here
            try {
                SAXParserFactory spf = SAXParserFactory.newInstance();
                SAXParser sp = spf.newSAXParser();
                XMLReader xr = sp.getXMLReader();

                /** Send URL to parse XML Tags */
                URL sourceUrl = new URL(
                        "url?api=ViewBooking_Admin");

                /** Create handler to handle XML Tags ( extends DefaultHandler ) */
                viewAllPartyHandler myXMLHandler = new viewAllPartyHandler();
                xr.setContentHandler(myXMLHandler);
                xr.parse(new InputSource(sourceUrl.openStream()));

                viewAllPartydataset parsedLoginDataSet = myXMLHandler
                        .getParsedRegistrationData();
                ArrayList&lt;String&gt; Bookingid = myXMLHandler.getbooking_id();
                ArrayList&lt;String&gt; partyname = myXMLHandler.br3;
                System.out.println("partyname :::: : "+partyname);
                /*str_blogImage = Bookingid.toArray(new String[Bookingid.size()]);
                str_morelink = partyname.toArray(new String[partyname.size()]);*/
                System.out.println("partyname :::: : "+partyname);

            } catch (Exception e) {
                // TODO: handle exception
            }
            return null;
        }

        @Override
        protected void onPostExecute(final Void unused) {

            lview3 = (ListView) findViewById(R.id.vap_listview);
            /*lview3.setAdapter(new
                    ArrayAdapter&lt;String&gt;(viewAllpartActivity.this,android.R.layout.simple_list_item_1 ,
                            str_morelink));*/

            lview3.setOnItemClickListener(viewAllpartActivity.this);

            if (this.dialog.isShowing()) {
                this.dialog.dismiss();

            }
        }
    }

    @Override
    public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {

        System.out.println("str_morelink ::: " + arg2);

        Bundle b = new Bundle();
        b.putString("url", str_morelink[arg2]);
        Intent i1 = new Intent(getBaseContext(), blogwebview.class);
        i1.putExtras(b);
        startActivity(i1);
        // finish();

    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            Intent homeback;

            homeback = new Intent(viewAllpartActivity.this, home.class);
            startActivity(homeback);

            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
}
</code></pre>
