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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:38:47+00:00 2026-05-16T15:38:47+00:00

I have a simple Android RSS reader app in which I am using SAX

  • 0

I have a simple Android RSS reader app in which I am using SAX parser to fetch the data. All the records are being fetched correctly except for the “desc” element. The XML structure is as below.

<item>
<title>Boilermaker Jazz Band</title>
<link>http://eventur.sis.pitt.edu/event.jsp?e_id=1805</link>
<type>Music Concerts</type>
<s_time>09-02-2010 05:00 PM&nbsp;</s_time>
<venue>Backstage Bar at Theater Square</venue>
<venue_addr/>
<desc>
<p><span style="font-family: arial, geneva, sans-serif; font-size: 11px;">
<p style="font-family: Arial, Helvetica, sans-serif; max-width: 600px; margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; font-size: 9pt; vertical-align: top;">Authentic American Jazz, Ragtime and Swing The Boilermaker Jazz Band is an ecstatically fun band performing authentic hot jazz, ragtime, and swing. The group has ....</desc>
−
<img_link>
http://eventur.sis.pitt.edu/images/Boilheadshot1.jpg
</img_link>
</item>

Data from all field is fetched as a whole. But when it comes to <desc>, the ‘characters’ method just fetches “<” and ignores the rest. Could some one please advise what could be done.

  • 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-05-16T15:38:49+00:00Added an answer on May 16, 2026 at 3:38 pm

    Your <desc> element contains another (invalid) XML structure. In your example, startElement() will be triggered for <p>, then <span>, then another <p>. If you want to extract only text, you could concatenate what the characters() method returns for all children of <desc> until you get notified of the end of <desc> element with endElement().

    Something like

    private boolean isDescStarted = false;
    
    private StringBuilder textDesc = new StringBuilder();
    
    public void startElement(String uri, String name, String qName, Attributes atts) {
       if(name.equals("desc") {isDescStarted = true;}
    }
    
    public void endElement(String uri, String name, String qName) {
       if(name.equals("desc") {
          isDescStarted = false;
          String fullTextDesc = textDesc.toString(); // do whatever you want with this string now
       }
    }
    
    public void characters(char[] buf, int offset, int length) {
       if (isDescStarted) {
          textDesc.append(new String(buf, offset, length));
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi im trying to create a simple android app using the Eclipse IDE, all
I have a simple Android app that pulls all music files on the phone
I have a simple android app that has quite a number of buttons, all
I have a simple Android OpenGL-ES app, and as all the models are very
I have a fairly simple android app, it gets protobuf data from a web
I am writing a simple android app which have a edittext and a button.
I have been trying to parse this ( http://app.calvaryccm.com/mobile/android/v1/devos ) URL using a SAX
I have a simple Android App using simple js, jquery mobile and phonegap that
I am using android 2.3.3, i had made an rss reader which was working
I have a simple Android app which should be able to allow navigation between

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.