Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8829519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:51:04+00:00 2026-06-14T07:51:04+00:00

In my app i have some 50 to 100 data to be parsed…also some

  • 0

In my app i have some 50 to 100 data to be parsed…also some images within 2 MB size…All these are to be retrieved to a single activity and are sorted and displayed there…

But its taking about 2 minutes…thats too much.

What to do for reducing the parse time?

Or am i wrong using SAX parsing???Suggestions please….

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

      /** Send URL to parse XML Tags */
      URL sourceUrl = new URL(url);

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

      } 

Code for XmlHandler.java

public class XmlHandler extends DefaultHandler{
static GetXml getxml;
Boolean currentElement = false;
String currentValue = null;


@Override
public void startElement(String uri, String localName, String qName,
    Attributes attributes) throws SAXException {
// TODO Auto-generated method stub
currentElement=true;
   if (localName.equals("root"))
    {
        /** Start */ 
       getxml = new GetXml();
    } 
}

@Override
public void endElement(String uri, String localName, String qName)
        throws SAXException {
    // TODO Auto-generated method stub
    currentElement=false;

    //**************************display page************************

    if (localName.equalsIgnoreCase("DisplayId"))
         getxml.setDisplayId(currentValue);     

     if (localName.equalsIgnoreCase("DisplayPage"))
         getxml.setDisplayPage(currentValue);

    //**************************category details************************

        if (localName.equalsIgnoreCase("CategoryId"))
             getxml.setCategoryId(currentValue);        

         if (localName.equalsIgnoreCase("CategoryName"))
             getxml.setCategory(currentValue);

        //**************************news details************************ 

         if (localName.equalsIgnoreCase("Picture"))
             getxml.setPictureName(currentValue);       

         if (localName.equalsIgnoreCase("newsHeading"))
             getxml.setNewsHeading(currentValue);

         if (localName.equalsIgnoreCase("Mainnews"))
             getxml.setMainNews(currentValue);




}
    @Override
public void characters(char[] ch, int start, int length)
        throws SAXException {
    // TODO Auto-generated method stub
     if (currentElement) {
            currentValue = new String(ch, start, length);
            currentElement = false;
        }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:51:05+00:00Added an answer on June 14, 2026 at 7:51 am

    The answer is likely that the SAX parser you’re using is checking the internet for the schema or DTD of your xml content. If you write an entityResolver that bypasses these checks, you’ll likely improve your start time (which is often 2 minutes or so).

    See this for more details.

    How to read well formed XML in Java, but skip the schema?

    This solved the problem for me using Xerces…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a greeting card app.I have some existing templates and i also
Background: I have some data thats stored in the web.config files of about 100
I have a WPF app that uses DataGrid to display some data. When I
We have an app that stores some data localy, none of this data is
in my app I have some text.setTextColor(Color.GRAY) . Now I would like to use
I have created a wildcard App ID and have some questions about bundle ID
I have question. I have some app on facebook and getting this error Fatal
I have some java-app, and i want to establish a connection to some https
i have some WinForms app (Framework to develop some simple apps), written in C#.
i have some WinForms app (Framework to develop some simple apps), written in C#.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.