I was using xsltproc as my XSLT
processor, but it ran out of memory on a large book, so I decided to try Xalan
and Saxon to convert a test book. I set up Xalan and Saxon according to the
instructions in Bob Stayton’s book, DocBook XSL: The Definitive Guide (http://www.sagehill.net/docbookxsl/index.html).
However, when I try to use FOP 0.93 to convert either of the attached FO
files, it reports the following exception:
org.xml.sax.SAXParseException:
Content is not allowed in prolog.
I pasted full output of the
exception below.
Has anyone else experienced this
problem? Please take a look at the attached FO files and tell me what’s
wrong.
Regards,
Jeff Powanda
[Fatal
Error] :1:1: Content is not allowed in prolog.
Jun
9, 2007 5:21:38 PM org.apache.fop.image.analyser.XMLReader
createDocument
WARNING:
Error while constructing image from XML
org.xml.sax.SAXParseException:
Content is not allowed in prolog.
at org.apache.xerces.parsers.DOMParser.parse(Unknown
Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
Source)
at
javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98)
at
org.apache.fop.image.analyser.XMLReader.createDocument(XMLReader.java:115)
at
org.apache.fop.image.analyser.XMLReader.loadImage(XMLReader.java:95)
at
org.apache.fop.image.analyser.XMLReader.verifySignature(XMLReader.java:65)
at
org.apache.fop.image.analyser.ImageReaderFactory.make(ImageReaderFactory.java:85)
at
org.apache.fop.image.ImageFactory.loadImage(ImageFactory.java:220)
at
org.apache.fop.image.ImageLoader.loadImage(ImageLoader.java:56)
at
org.apache.fop.image.ContextImageCache.getImage(ImageFactory.java:432)
at
org.apache.fop.image.ImageFactory.getImage(ImageFactory.java:157)
at
org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:68)
at org.apache.fop.fo.FObj.processNode(FObj.java:118)
at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:321)
at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown
Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
at
org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
at org.apache.fop.cli.Main.startFOP(Main.java:160)
at org.apache.fop.cli.Main.main(Main.java:191)
Jun
9, 2007 5:21:38 PM org.apache.fop.image.ImageFactory
loadImage
SEVERE:
Error while recovering image information () : null
java.lang.NullPointerException
at
org.apache.fop.image.analyser.XMLReader.verifySignature(XMLReader.java:66)
at
org.apache.fop.image.analyser.ImageReaderFactory.make(ImageReaderFactory.java:85)
at
org.apache.fop.image.ImageFactory.loadImage(ImageFactory.java:220)
at
org.apache.fop.image.ImageLoader.loadImage(ImageLoader.java:56)
at
org.apache.fop.image.ContextImageCache.getImage(ImageFactory.java:432)
at
org.apache.fop.image.ImageFactory.getImage(ImageFactory.java:157)
at
org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:68)
at org.apache.fop.fo.FObj.processNode(FObj.java:118)
at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:321)
at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown
Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
at
org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
at org.apache.fop.cli.Main.startFOP(Main.java:160)
at org.apache.fop.cli.Main.main(Main.java:191)
Jun
9, 2007 5:21:38 PM org.apache.fop.fo.flow.ExternalGraphic
bind
SEVERE:
Image not available: url()
Jun
9, 2007 5:21:39 PM org.apache.fop.cli.Main startFOP
SEVERE:
Exception
javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException:
file:///c:/docs/40SP/xml/other/indextest/IndexTest.fo:13:11234:
Error(13/11234): fo:block is not a valid child element of
fo:root.
at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
at
org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
at org.apache.fop.cli.Main.startFOP(Main.java:160)
at org.apache.fop.cli.Main.main(Main.java:191)
---------
javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException:
file:///c:/docs/40SP/xml/other/indextest/IndexTest.fo:13:11234:
Error(13/11234): fo:block is not a valid child element of
fo:root.
at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:501)
at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
at
org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
at org.apache.fop.cli.Main.startFOP(Main.java:160)
at org.apache.fop.cli.Main.main(Main.java:191)
Caused
by: org.apache.fop.fo.ValidationException:
file:///c:/docs/40SP/xml/other/indextest/IndexTest.fo:13:11234:
Error(13/11234): fo:block is not a valid child element of
fo:root.
at
org.apache.fop.fo.FONode.invalidChildError(FONode.java:393)
at
org.apache.fop.fo.FONode.invalidChildError(FONode.java:378)
at
org.apache.fop.fo.pagination.Root.validateChildNode(Root.java:127)
at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:303)
at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown
Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
... 4 more
---------
org.apache.fop.fo.ValidationException:
file:///c:/docs/40SP/xml/other/indextest/IndexTest.fo:13:11234:
Error(13/11234): fo:block is not a valid child element of
fo:root.
at
org.apache.fop.fo.FONode.invalidChildError(FONode.java:393)
at
org.apache.fop.fo.FONode.invalidChildError(FONode.java:378)
at
org.apache.fop.fo.pagination.Root.validateChildNode(Root.java:127)
at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:303)
at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown
Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
at
org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
at org.apache.fop.cli.Main.startFOP(Main.java:160)
at org.apache.fop.cli.Main.main(Main.java:191)