I am getting error while running a test case regarding Handler issue.
Can you help me ?

Here is a code :-

*A Method which returns a ContentHandler :-*

 protected ContentHandler getRendererAsHandler(
                 final OutputStream anOutputStream)
                throws ReportException
                FOUserAgent foUserAgent = fopFactory.newFOUserAgent();          
                          ContentHandler ch = null;
                try {
                        Fop fop =
                        ch = fop.getDefaultHandler();                  
                        } catch (Exception e) {
                                // TODO Auto-generated catch block
                        return ch;             

*A class that calls above method and transform into PDF or printable format

ContentHandler handler = (ContentHandler)

SAXTransformerFactory tFactory =
            Transformer transformer = tFactory.newTransformer();

            final SAXSource inputSource =
                new SAXSource(this.xmlReader, new
         *   transformer.transform(inputSource, new SAXResult(handler));*

On this line i am getting error like unable to transform : - 

ReportException:Failed to transform report
Caused by:
org.apache.fop.fo.ValidationException: First element must be the fo:root
formatting object. Found (Namespace URI:
"http://www.xx.com/xx/ReportTemplate";, Local Name: "reportTemplate")
instead. Please make sure you're producing a valid XSL-FO document.

On debug i got FOTreeBuilder object instead ContentHandler object , Thats
why i think it caused error, I also tried to type cast it but not working

I konw it is some silly mistake but i am new to FOP , So can't able to
resolve it.

View this message in context: 
Sent from the FOP - Dev mailing list archive at Nabble.com.

Reply via email to