cancel
Showing results for 
Search instead for 
Did you mean: 

SAX Parser in Webdynpro for Java

Former Member
0 Kudos

Hi,

Scenario : To get data entered in the Dynamic table of an online PDF form.

I have got the XML of the PDF form. The problem is with Parsing the XML to get the data.

I am using SAX parser. The code structure is as given,

public class Outercomp
{
    getPDFData(IS);    // IS is the Inputstream of the PDF XML
    
   // begin Others
   public static class inner extends DefaultHandler
   {
        void getPDFData(InputStream IS)
        {
              SAXParserFactory SAXfac = SAXParserFactory.newInstance();
              SAXParser SAX = SAXfac.newSAXParser();
              SAX.parse(IS, new Outer.Inner());
        }
        void startElement()
        {             
             // some Code 
        }
   }
}

Problem :

I am getting the below exception at calling the method 'parse'.

com.sap.engine.lib.xml.parser.NestedSAXParserException: Generic Exception: -> java.lang.NullPointerexception

I checked both 'IS' and 'new Outer.Inner()', both are not null.

Please give me a solution

Thanks,

Prabhakar

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Are you extending the DefaultHandler class or are you implementing some interface?

Regards,

Satyajit.

Former Member
0 Kudos

Hi Satyajit,

' DefaultHandler ' is a class, and I am extending it.

First I missed it in the code, now I have changed it. Thanks for reminding me.

Thanks,

Prabhakar