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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:09:58+00:00 2026-06-10T01:09:58+00:00

I am using an XML parser to parse through and XML response. I need

  • 0

I am using an XML parser to parse through and XML response. I need to get all the links in the XML page that I’m parsing, and those are showed in this form:

<src url="link"> Link Name </src>

How can I get the “link”? I only know how to get the “Link Name” using

if(name.equals("url"))
    text = parser.getNextText(); 

Thank you for helping!

This is my code:

try 
    {       
        XmlPullParserFactory factory = XmlPullParserFactory.newInstance();  
        XmlPullParser parser = factory.newPullParser();  
        parser.setInput( new StringReader( response ) );
        int k=0;
        int event;
          while (true) {  

              event = parser.next();  

              if (event == XmlPullParser.START_TAG)
                  {  
                   String name = parser.getName();  

                      String text = null;  
                      while (true) {                             

                          if (name.equals("t")) 
                              {                                   

                                  text = parser.nextText();
                                  title.setText(text);

                              }
                                  else 
                                    if(name.equals("jt"))
                                    {
                                    text = parser.nextText();    
                                    if(!text.equals(""))
                                    adapter.add(text);
                                    }   
                                     else 
                                        if(name.equals("src"))
                                        {
                                        text = parser.(); 
                                        System.out.println(text);
                                        if(!text.equals(""))                                            
                                        link.add(text);
                                        }

                          event = parser.next();
                          if (event == XmlPullParser.START_TAG) {  
                              name = parser.getName(); 
                              if (name.equals("shrs"))  
                                  break;

                          } 
                          else break;
                          }


                      }  

               else if (event == XmlPullParser.END_TAG && parser.getName().equals("shrs"))  
                 break;  
  • 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-10T01:10:00+00:00Added an answer on June 10, 2026 at 1:10 am

    I think you search something like this?

        int countAtr= text.getAttributeCount();
        if(countAtr > 0) {
            attrs = new HashMap<String,String>(acount);
            for(int i=0;x<countAtr;x++) {
                attrs.put(parser.getAttributeName(x), parser.getAttributeValue(x));
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am parsing through a XML file that's about 12mb big. I need to
I'm using minidom to parse through an xml document. I took the data with
I am using DOM parser to parse xml data, but its taking lots of
I have a problem with using the SAX parser to parse a XML file.
I want to parse the xml file with dynamic content using DOM parser in
NOT USING A XML PARSER I want to get the contents of the XML
Possible Duplicate: Best XML Parser for PHP Using JAXB with Google Android I need
I am using ColdFusion 8. I am parsing an XML document and need to
I am currently using Poco::XML to parse through a number of very large XML
I'm using XML::Simple in Perl to parse through an XML file and I'm stuck

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.