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

  • Home
  • SEARCH
  • 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 6698077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:32:06+00:00 2026-05-26T06:32:06+00:00

Hope someone can provide some guidance – i’ve been using android sax parser with

  • 0

Hope someone can provide some guidance – i’ve been using android sax parser with several feeds. Now when I want to parse an item that contains following:

<category>category</category>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">creator</dc:creator>
<dc:date xmlns:dc="http://purl.org/dc/elements/1.1/">2011-10-13T07:00:15Z</dc:date>
<geo:lat>51.95271682739258</geo:lat>
<geo:long>-0.21096819639205933</geo:long>

I can get the value of “category” tag, but nothing for the others.

The code used follows examples from http://www.ibm.com/developerworks/opensource/library/x-android/, in particular snippet to parse the tags:

Element item = channel.getChild("item");

item.getChild("category").setEndTextElementListener(new EndTextElementListener() {
  public void end(String body) {
   Log.e("mydebug","cat>>"+body+"<");
  }
});
item.getChild("dc:creator").setEndTextElementListener(new EndTextElementListener() {
  public void end(String body) {
   Log.e("mydebug","creator>>"+body+"<");
  }
});

generates this output:

10-13 14:13:12.763: ERROR/mydebug(609): cat>>category<
10-13 14:13:12.763: ERROR/mydebug(609): cat>>category2<

I’m using the following:

import android.sax.Element;
import android.sax.EndElementListener;
import android.sax.EndTextElementListener;
import android.sax.RootElement;
import android.util.Log;
import android.util.Xml;

Anything I’m missing?
Only thing I can guess is that “:” in the tag is giving me problems, but I couldn’t find any examples of similar issue.

Many thanks for reading.

  • 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-26T06:32:07+00:00Added an answer on May 26, 2026 at 6:32 am

    When using the startElement() and endElement() methods in your DefaultHandler, both the local name and qualified name values are passed in. Make sure you’re checking the qualified name for things like ‘dc:creator’ or else they won’t match.

    See the official documentation here: http://developer.android.com/reference/org/xml/sax/helpers/DefaultHandler.html#startElement%28java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes%29

    Also, you may consider using the XML Pull Parser as it’s a bit more light weight than SAX and might be more appropriate for your needs: http://developer.android.com/reference/org/xmlpull/v1/XmlPullParserFactory.html

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

Sidebar

Related Questions

I'm almost losing it, i really hope someone can help me out! I'm using
I've search for some clues on this problem without much success. Hope someone can
Hope someone can advice but looking for an API service that can provide traveling
Hope someone can help with this. I've been up and down the web and
I'm overlooking something and I hope someone can provide me with a resource on
I hope someone can help with this issue. I have a popup iframe using
hope someone can help. I have two tables: Users -UserID -UserName UsersType -UserTypeID -UserID
I hope someone can guide me as I'm stuck... I need to write an
I hope someone can help me with this, as I'm unable to find the
I hope someone can help here, we're having an incredibly annoying time with Visual

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.