Hi,
I'm getting following exception while generating a pdf using FOP.

****************************************************************************************
file:///D:/tempReports/testReport.xml; Line 2; Column 24; 
org.apache.fop.apps.FOPException
        at 
org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:109)
        at com.cpb.util.PDFWriter.renderXML(PDFWriter.java:89)
        at com.cpb.util.PDFWriter.Print(PDFWriter.java:70)
        at com.cpb.util.PDFWriter.main(PDFWriter.java:43)

---------

java.lang.reflect.InvocationTargetException: org.apache.fop.apps.FOPException: 
stylesheet requires a
ttribute: version
        at 
org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:103)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102)
        at com.cpb.util.PDFWriter.renderXML(PDFWriter.java:89)
        at com.cpb.util.PDFWriter.Print(PDFWriter.java:70)
        at com.cpb.util.PDFWriter.main(PDFWriter.java:43)

---------


---------

org.apache.fop.apps.FOPException: stylesheet requires attribute: version
        at 
org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:103)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102)
        at com.cpb.util.PDFWriter.renderXML(PDFWriter.java:89)
        at com.cpb.util.PDFWriter.Print(PDFWriter.java:70)
        at com.cpb.util.PDFWriter.main(PDFWriter.java:43)

---------

javax.xml.transform.TransformerConfigurationException: stylesheet requires 
attribute: version
        at 
org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.jav
a:815)
        at 
org.apache.xalan.processor.TransformerFactoryImpl.newXMLFilter(TransformerFactoryImpl.jav
a:486)
        at 
org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:84)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102)
        at com.cpb.util.PDFWriter.renderXML(PDFWriter.java:89)
        at com.cpb.util.PDFWriter.Print(PDFWriter.java:70)
        at com.cpb.util.PDFWriter.main(PDFWriter.java:43)
---------
javax.xml.transform.TransformerException: stylesheet requires attribute: version
        at 
org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.jav
a:813)
        at 
org.apache.xalan.processor.TransformerFactoryImpl.newXMLFilter(TransformerFactoryImpl.jav
a:486)
        at 
org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:84)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102)
        at com.cpb.util.PDFWriter.renderXML(PDFWriter.java:89)
        at com.cpb.util.PDFWriter.Print(PDFWriter.java:70)
        at com.cpb.util.PDFWriter.main(PDFWriter.java:43)
---------
javax.xml.transform.TransformerException: stylesheet requires attribute: version
        at 
org.apache.xalan.processor.StylesheetHandler.error(StylesheetHandler.java:866)
        at 
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementPr
ocessor.java:389)
        at 
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementPr
ocessor.java:300)
        at 
org.apache.xalan.processor.ProcessorLRE.startElement(ProcessorLRE.java:184)
        at 
org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:632)
        at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
        at 
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1170)

        at 
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScan
ner.java:994)
        at 
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952)
        at 
org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.jav
a:795)
        at 
org.apache.xalan.processor.TransformerFactoryImpl.newXMLFilter(TransformerFactoryImpl.jav
a:486)
        at 
org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:84)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102)
        at com.cpb.util.PDFWriter.renderXML(PDFWriter.java:89)
        at com.cpb.util.PDFWriter.Print(PDFWriter.java:70)
        at com.cpb.util.PDFWriter.main(PDFWriter.java:43)
---------
; SystemID: file:///D:/tempReports/testReport.xml; Line#: 2; Column#: 24
; SystemID: file:///D:/tempReports/testReport.xml; Line#: 2; Column#: 24
javax.xml.transform.TransformerException: stylesheet requires attribute: version
        at 
org.apache.xalan.processor.StylesheetHandler.error(StylesheetHandler.java:852)
        at 
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementPr
ocessor.java:389)
        at 
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementPr
ocessor.java:300)
        at 
org.apache.xalan.processor.ProcessorLRE.startElement(ProcessorLRE.java:184)
        at 
org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:632)
        at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
        at 
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1170)

        at 
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScan
ner.java:994)
        at 
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952)
        at 
org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.jav
a:795)
        at 
org.apache.xalan.processor.TransformerFactoryImpl.newXMLFilter(TransformerFactoryImpl.jav
a:486)
        at 
org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:84)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102)
        at com.cpb.util.PDFWriter.renderXML(PDFWriter.java:89)
        at com.cpb.util.PDFWriter.Print(PDFWriter.java:70)
        at com.cpb.util.PDFWriter.main(PDFWriter.java:43)
---------
javax.xml.transform.TransformerException: stylesheet requires attribute: version
        at 
org.apache.xalan.processor.StylesheetHandler.error(StylesheetHandler.java:866)
        at 
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementPr
ocessor.java:389)
        at 
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementPr
ocessor.java:300)
        at 
org.apache.xalan.processor.ProcessorLRE.startElement(ProcessorLRE.java:184)
        at 
org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:632)
        at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
        at 
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1170)

        at 
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScan
ner.java:994)
        at 
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952)
        at 
org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.jav
a:795)
        at 
org.apache.xalan.processor.TransformerFactoryImpl.newXMLFilter(TransformerFactoryImpl.jav
a:486)
        at 
org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:84)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102)
        at com.cpb.util.PDFWriter.renderXML(PDFWriter.java:89)
        at com.cpb.util.PDFWriter.Print(PDFWriter.java:70)
        at com.cpb.util.PDFWriter.main(PDFWriter.java:43)
---------
; SystemID: file:///D:/tempReports/testReport.xml; Line#: 2; Column#: 24
; SystemID: file:///D:/tempReports/testReport.xml; Line#: 2; Column#: 24
javax.xml.transform.TransformerException: stylesheet requires attribute: version
        at 
org.apache.xalan.processor.StylesheetHandler.error(StylesheetHandler.java:852)
        at 
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementPr
ocessor.java:389)
        at 
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementPr
ocessor.java:300)
        at 
org.apache.xalan.processor.ProcessorLRE.startElement(ProcessorLRE.java:184)
        at 
org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:632)
        at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
        at 
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1170)

        at 
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScan
ner.java:994)
        at 
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952)
        at 
org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.jav
a:795)
        at 
org.apache.xalan.processor.TransformerFactoryImpl.newXMLFilter(TransformerFactoryImpl.jav
a:486)
        at 
org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:84)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102)
        at com.cpb.util.PDFWriter.renderXML(PDFWriter.java:89)
        at com.cpb.util.PDFWriter.Print(PDFWriter.java:70)
        at com.cpb.util.PDFWriter.main(PDFWriter.java:43)
Exception: org.apache.fop.apps.FOPException
****************************************************************************************


-----Original Message-----
From: Katiyar, Bhawana [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 06, 2002 7:30 PM
To: chandrakant_binwani
Subject: RE: Problem with PDF generation


Try catching and printing the exception and then send that exception to 
fop-users list. There will certainly be an exception.
Thanks
Bhawana

-----Original Message-----
From: chandrakant_binwani [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 06, 2002 4:42 AM
To: [EMAIL PROTECTED]
Subject: Problem with PDF generation



While trying to generate a PDF from a xml using a xsl...
the pdf generated is a 0KB one.

Driver driver = new Driver();
driver.setRenderer(Driver.RENDER_PDF);
XMLReader parser = input.getParser();
driver.setOutputStream(new FileOutputStream(pdffile));
driver.render(parser, input.getInputSource());

I'm using FOP version fop-0.20.3.
There were no errors while pdf generation.
What could be the problem ??

Regards,
Chandrakant.

Reply via email to