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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:28:35+00:00 2026-05-13T16:28:35+00:00

I’ve been fiddling for 3 hours and I can’t get this F***** parser to

  • 0

I’ve been fiddling for 3 hours and I can’t get this F***** parser to work. Sorry for cursing.
I don’t understand why I can’t find one decent tutorial that does exactly what I want.

I just want to send the function a String/XML. Then, parse it. it’s not that hard. In python, I can do it with my eyes closed. Awesome, freaking documentation right here: http://www.crummy.com/software/BeautifulSoup/documentation.html

import BeautifulSoup
soup = BeautifulSoup(the_xml)
persons_name = soup.findAll('first_name')[0].string

Why can’t I find a good, simple, documentation that teaches me how to parse XML????? This is my current code for JAVA SAX, and its not working, and I don’t even know why.

  public static void parseit(String thexml)
    {
      SAXParserFactory factory = SAXParserFactory.newInstance();
      try {   
            SAXParser saxParser = factory.newSAXParser();
            saxParser.parse( thexml , new DefaultHandler() );
      } catch (Throwable err) {
            err.printStackTrace ();
      }
    }

Can someone just write me the code to parse the XML using SAX parser…please…It’s just like 5 lines of code.

  • 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-13T16:28:36+00:00Added an answer on May 13, 2026 at 4:28 pm

    Ok, so what you need to do is to implement your own handler (instead of using default one). So replace

    saxParser.parse( thexml , new DefaultHandler() );
    

    with

     saxParser.parse( thexml , new MyFreakingHandler() );
    

    where MyFreakingHandler implements interface HandlerBase or it can extend DefaultHandler class. Then simply provide implementation for such methods like

    public void startDocument () throws SAXException
    public void endElement (String name) throws SAXException
    

    I don’t know however why you could not find any tutorial on the web. I haven’t been using SAXParser for at least 3 years now and in order to answer your post I just simply asked Google for help.

    EDIT:

    Ok, so to clear things out. There used to be an official Java tutorial for SAX, that somehow I cannot find on the web now, however there are still number of decent non-official tutorials that can be quite helpful. Try with this on for instance: http://www.java-samples.com/showtutorial.php?tutorialid=152

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the

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.