asciidoctor / asciidoctor-fopub

A portable DocBook-to-PDF build command that wraps DocBook XSL and Apache FOP
MIT License
113 stars 37 forks source link

Problem converting xml to pdf #23

Open bizzguy opened 10 years ago

bizzguy commented 10 years ago

I've created an xml file from adoc format using asciidoctor. When I run fopub on it I get an error (as shown below). I've verified that the PDF generation works correctly by running the fopub README.adoc through it. My guess is that my original adoc has some kind of format error. How do I debug this. Is there an error in the xml that prevents the PDF from being generated? How do I trace that back to the original adoc since the error messages don't point to any line numbers?

Jun 24, 2014 7:02:46 AM org.apache.fop.events.LoggingEventListener processEvent INFO: Rendered page #1. Jun 24, 2014 7:02:46 AM org.apache.fop.cli.Main startFOP SEVERE: Exception org.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException: "fo:flow" is missing child elements. Required content model: marker* (%block;)+ (No context info available) javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: "fo:flow" is missing child elements. Required content model: marker* (%block;)+ (No context info available) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:304) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:130) at org.apache.fop.cli.Main.startFOP(Main.java:177) at org.apache.fop.cli.Main.main(Main.java:208)

mojavelinux commented 10 years ago

Tracing back these issues is tricky because of the number of conversion steps. The line numbers aren't printed because of a bug inside of Apache FOP when both conversion steps are performed in one pass. The way to get the line numbers is to generate the "fo" file and the "pdf" file in discrete steps.

fopub -f fo test.xml
fopub -f pdf test.fo

Could you provide the original AsciiDoc file so that we can get some clues as to what might be causing this problem?

Also, could you validate the XML file?

xmllint --noout --valid test.xml

Usually, errors in FOP happen as a result of errors in the DocBook.

bizzguy commented 10 years ago

I had some problems with my asciidoc file so it was my own fault. I'll try out the line number suggestions. Thanks.