Content not allowed in prolog error when transforming XML with FO
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Thu Jun 26, 2025 12:54 am
Content not allowed in prolog error when transforming XML with FO
I'm hoping that I've just missed something obvious, but I'm kind of running out of ideas - basically, my goal is to transform XML files into pdfs using an XSLT stylesheet which uses the FO syntax. This works fine in the debugger mode (so if I run the debugger, save the output, and apply the transformation to the output) but whenever I try to just click 'apply transformation scenario' on the original xml file it throws up the error code:
org.apache.fop.apps.FOPException: net.sf.saxon.trans.XPathException: org.xml.sax.SAXParseException [filename] Content is not allowed in prolog.
My UTF-8 BOM handling preferences are set to "Don't write", the transformation scenario is set up with Saxon PE 11.4 and the built-in Apache FOP processor. I've checked the box to use the XSLT result as input. Both the xml file and the xslt begin with the declaration
and as far as I can tell there's no whitespace in front of it. The XSLT sheet also starts with and when I run it in the debugger, the output file starts with the proper <fo:> element. So I can't find any reason why there should be content in the prolog, or how to fix it. What am I missing here?
org.apache.fop.apps.FOPException: net.sf.saxon.trans.XPathException: org.xml.sax.SAXParseException [filename] Content is not allowed in prolog.
My UTF-8 BOM handling preferences are set to "Don't write", the transformation scenario is set up with Saxon PE 11.4 and the built-in Apache FOP processor. I've checked the box to use the XSLT result as input. Both the xml file and the xslt begin with the declaration
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
Code: Select all
<xsl:output method="xml" encoding="utf-8" indent="yes" omit-xml-declaration="yes"/>
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service