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 9196821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:56:04+00:00 2026-06-17T21:56:04+00:00

I am parsing an XML file from assets folder to dump my data into

  • 0

I am parsing an XML file from assets folder to dump my data into the database. Later on i may fetch this and display it in a text view. But while parsing i am losing some data, ie, if i have some 50 words within the XML tags before parsing, in my database i am not able to find all of them after parsing.

For exmple:
I am parsing this line:

<about>Skandagiri also known as kalavara durga, is an ancient mountain fortess located approximately 70km from Banglore city and 3 km from Chikkaballapur in the Indian State of Karnataka.It is off Bellary road(NH 7, Hyderabad to Bangalore Highway) and overlooks Nandi Hills, Mudddenahalli and Kanive narayanapura.The peak is at an altitude of about 1350 meters</about>

after parsing in my database:

at an altitude of about 1350 

i am using String to hold my parsed value like this:

if (element.equalsIgnoreCase("about")){
  String str=parsedValue;
}   
  • 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-17T21:56:05+00:00Added an answer on June 17, 2026 at 9:56 pm

    Use a StringBuffer, since text can be read in chunks and you may be reading just the part of code.
    use string buffer and append all the chunks, so that finally you will get the complete text without missing out any data.

    Like this:

    StringBuffer strbufr = new StringBuffer();
    
        if (element.equalsIgnoreCase("about")){
          String str = strbufr.toString().trim();
        }  
    
        @Override
            public void characters(char[] ac, int i, int j) throws SAXException {
                strbufr.append(ac, i, j);
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML file from which I am parsing some content to display
I got a string from parsing a XML file which looks like this: Fri,
I am parsing an XML file from a URL, from this XML I parse
I am parsing an xml file from an API which I have converted into
I am parsing xml file from SDcard and display it in textview. whenever i
I am doing parsing on xml file and fetched data from xml file and
I am parsing xml file data from an url. All works great when device
I have this NSXMLParser that parsing an XML file from a webserver parser =
I am parsing xml file from server using xmlParser in Android. When i print
I am using feedparser for parsing from XML file.But I couldn't parse <geo:lat> ,

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.