You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by pa...@templum.it on 2002/11/08 21:52:31 UTC
Error using xml2pdf.xsl and xslfoRef.xml
Hallo!
It's the first time i use fop. I try to embed fop into a java class like FopServlet.java does. To test my class i've used xml2pdf.xsl and xslfoRef.xml but u got the following exception :
[ERROR] Unknown formatting object ^root
org.apache.fop.apps.FOPException: Root element must be root, not (none):root
at org.apache.fop.fo.FOTreeBuilder.startElement(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:434)
at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(XMLNamespaceBinder.java:832)
at org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinder.java:568)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:796)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:752)
at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(XMLDocumentScannerImpl.java:927)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1519)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:529)
at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:585)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1148)
at org.apache.fop.apps.Driver.render(Unknown Source)
at com.isyde.testfop.CreatePdf.renderXML(CreatePdf.java:118)
at com.isyde.testfop.CreatePdf.<init>(CreatePdf.java:61)
at com.isyde.testfop.CreatePdf.main(CreatePdf.java:161)
Exception in thread "main"
Can You help me?
Many Thanks!
Paolo B.
Re: Error using xml2pdf.xsl and xslfoRef.xml
Posted by Oleg Tkachenko <ol...@multiconn.com>.
paolo.beatrici@templum.it wrote:
> I've used xml2pdf.xsl and xslforef.xml in the distribution directory "docs",
> so i think they are correct.
> My parser is Xerces.
Well, it gets convolute. These xml and xsl surely okay. Try if it works from a
command line - run the following from within FOP directoiry:
fop.bat -xml docs/xslfoRef.xml -xsl docs/xml2pdf.xsl -pdf test.pdf -d
If it works therefore the problem is in the environment you are trying to
embed FOP to. Make sure it uses jars from FOP distribution (especially xerces
and xalan).
--
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel
Re: Error using xml2pdf.xsl and xslfoRef.xml
Posted by pa...@templum.it.
I've used xml2pdf.xsl and xslforef.xml in the distribution directory "docs",
so i think they are correct.
My parser is Xerces.
Paolo Beatrici.
----- Original Message -----
From: "J.Pietschmann" <j3...@yahoo.de>
To: <fo...@xml.apache.org>
Sent: Friday, November 08, 2002 10:29 PM
Subject: Re: Error using xml2pdf.xsl and xslfoRef.xml
> paolo.beatrici@templum.it wrote:
> > Hallo!
> > It's the first time i use fop. I try to embed fop into a java class like
> > FopServlet.java does. To test my class i've used xml2pdf.xsl and
> > xslfoRef.xml but u got the following exception :
> >
> > [ERROR] Unknown formatting object ^root
> > org.apache.fop.apps.FOPException: Root element must be root, not
(none):root
>
> The most likely reason is that you didn't declare or use
> the XSLFO namespace properly. Look into the docs/examples
> directory in your FOP distribution for some examples
> how a FO file should look like, and perhaps look specifically
> at the glossary.xml/glossary.xsl combo for how it might look
> in XSLT.
> Another possibility is that your XML parser is somehow
> configured to not recognize namespaces. Seek local help in this
> case.
>
> J.Pietschmann
>
>
Re: Error using xml2pdf.xsl and xslfoRef.xml
Posted by "J.Pietschmann" <j3...@yahoo.de>.
paolo.beatrici@templum.it wrote:
> Hallo!
> It's the first time i use fop. I try to embed fop into a java class like
> FopServlet.java does. To test my class i've used xml2pdf.xsl and
> xslfoRef.xml but u got the following exception :
>
> [ERROR] Unknown formatting object ^root
> org.apache.fop.apps.FOPException: Root element must be root, not (none):root
The most likely reason is that you didn't declare or use
the XSLFO namespace properly. Look into the docs/examples
directory in your FOP distribution for some examples
how a FO file should look like, and perhaps look specifically
at the glossary.xml/glossary.xsl combo for how it might look
in XSLT.
Another possibility is that your XML parser is somehow
configured to not recognize namespaces. Seek local help in this
case.
J.Pietschmann