Results 1 to 3 of 3
  1. #1
    Noobverse is offline Member
    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0

    Default A beginner question about SAX

    Hello
    I have just started working with the default Sax parser, and just to check the event handlers I wrote some simple code. The only thing I o not understand is why the new handler is not printing a simple message on start of the document/start of the element ? What am I doing wrong here.

    Thanks
    Attached Files Attached Files

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    760
    Rep Power
    8

    Default Re: A beginner question about SAX

    Remember that java is a case sensitive language which mean the case of the letter is important. For instance startDocument is not the same with StartDocument. In your case you name your method as StartDocument where it should be startDocument. To make sure that you've override the correct method you can use the @Override annotation. So fix it, your code should be like this:

    Java Code:
        @Override
        public void startDocument() throws SAXException {
            System.out.println("startDocument");
        }

  3. #3
    Noobverse is offline Member
    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0

    Default Re: A beginner question about SAX

    Thanks, I am feeling extremely stupid right now: - I used to write in Fortran and Pascal was my first language, apparently it still shows. Will be more carefull with the cases in the future.

Similar Threads

  1. A beginner question.
    By MhilleXD in forum New To Java
    Replies: 2
    Last Post: 10-02-2012, 10:41 AM
  2. Beginner GUI question
    By stuckonjava in forum New To Java
    Replies: 4
    Last Post: 02-16-2012, 11:16 PM
  3. Java Question [Beginner Question]
    By joker760 in forum New To Java
    Replies: 3
    Last Post: 12-13-2011, 04:01 PM
  4. Another beginner question for AP test
    By DanK in forum New To Java
    Replies: 1
    Last Post: 04-27-2009, 05:36 AM
  5. Beginner Java question
    By DanK in forum New To Java
    Replies: 3
    Last Post: 04-27-2009, 04:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •