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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:05:13+00:00 2026-06-03T03:05:13+00:00

I am having a little trouble with my XML parser, effectively I have an

  • 0

I am having a little trouble with my XML parser, effectively I have an XML structure like so:

<c r="K6" s="35">
  <v>135</v> 
</c>

& I need to extract the value v XXX /v dependent on whether c r=”K6″ s=”35″ falls within a specific range. This is simple enough using reg ex’s etc… but my issue is that when I pull down the qName in startElement(), rather than returning the value: c r="K6" s="35" its simply returns: c. I am 99% sure this is because qName breaks at the first space. How can I get qName to return everything within the <> brackets?

Cheers

  • 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-03T03:05:14+00:00Added an answer on June 3, 2026 at 3:05 am

    XML tags cannot contain spaces. What you have in your XML element is

    • A tag called c,
    • …that has an attribute called r with the value K6,
    • …and another attribute called s with the value 35.

    SAXParser already returns the values of all attributes to you in the attribute list that you get along with the element that has its qName set to "c".

    public void startElement(String uri, String localName, String qName, Attributes attributes) {
        if ("c".equals(qName)) {
            System.out.println(attributes.getValue("r"));
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a little trouble with something. I have an HttpGet method like this:
I'm having a little trouble as I decide how to structure my projects. This
I'm having a little trouble getting values out of an XML document. The document
Im having a little trouble setting up routes. I have a 'users' controller/model/views set
I'm having a little trouble defining my question. Here's what I have. A mailto
Im having a little trouble understanding how I should work with xml files, so
I'm having a little trouble parsing a string of xml called responseText in android.
Having a little trouble on this one. I need a way using Jquery/JS to
Im having a little trouble constructing a query. I have a table with 3
I have having a little trouble wrapping my head around the design pattern for

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.