PDF: Fails with XSL-FO but succeeds with HTML5&CSS

Post here questions and problems related to editing and publishing DITA content.
Carl
Posts: 102
Joined: Fri Oct 19, 2018 2:19 am

PDF: Fails with XSL-FO but succeeds with HTML5&CSS

Post by Carl »

I have a project that succeeds when I use the transformations "DITA Map WebHelp Responsive" and "DITA Map PDF - based on HTML & CSS". However it fails when I use "DITA Map PDF - based on XSL-FO". Unfortunately, I need to use the XSL-FO transformation.

I cannot decipher the transformation problems:

Code: Select all

System ID: /home/clum/repos/docs-cust/PHEMI_Central/PHEMI_UNIFIED_TESTING.ditamap
Scenario: DITA Map PDF - based on XSL-FO - Copy
Input file: /home/clum/repos/docs-cust/PHEMI_Central/PHEMI_UNIFIED_TESTING.ditamap
Engine name: FOP
Severity: error
Description: net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: "fo:page-sequence" is not a valid child of "fo:block"! (See position 79:102)

System ID: /home/clum/repos/docs-cust/PHEMI_Central/temp/pdf/oxygen_dita_temp/topic.fo
Scenario: DITA Map PDF - based on XSL-FO - Copy
Input file: /home/clum/repos/docs-cust/PHEMI_Central/PHEMI_UNIFIED_TESTING.ditamap
Engine name: FOP
Severity: error
Description: "fo:page-sequence" is not a valid child of "fo:block"!
Start location: 79:0

System ID: /home/clum/Oxygen XML Author 22/frameworks/dita/DITA-OT3.x/plugins/org.dita.base/build.xml
Scenario: DITA Map PDF - based on XSL-FO - Copy
Input file: /home/clum/repos/docs-cust/PHEMI_Central/PHEMI_UNIFIED_TESTING.ditamap
Engine name: DITA-OT
Severity: error
Description: The following error occurred while executing this line:
Start location: 29:0

System ID: /home/clum/Oxygen XML Author 22/frameworks/dita/DITA-OT3.x/plugins/org.dita.pdf2.fop/build_fop.xml
Scenario: DITA Map PDF - based on XSL-FO - Copy
Input file: /home/clum/repos/docs-cust/PHEMI_Central/PHEMI_UNIFIED_TESTING.ditamap
Engine name: DITA-OT
Severity: error
Description: org.apache.fop.apps.FOPException: org.apache.fop.apps.FOPException: net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: "fo:page-sequence" is not a valid child of "fo:block"! (See position 79:102)
Start location: 145:0
Any hints on how I can begin to figure this out? I'm finding that the XSL-FO transformation to be very unyielding.
gravitythread
Posts: 1
Joined: Fri Nov 06, 2020 2:39 am

Re: PDF: Fails with XSL-FO but succeeds with HTML5&CSS

Post by gravitythread »

Hi,
I would start by checking the FO file produced in 'pdf/oxygen_dita_temp/topic.fo'. You can open that as an XML file in Oxygen. The validation error states that something went rather wrong when a 'chapter' element was placed inside a 'para' element.

Finding the content that caused this error will help you understand where it comes from in your source, and maybe fix some content strangeness that is causing the publish failure.

Regards,
Greg
julien_lacour
Posts: 496
Joined: Wed Oct 16, 2019 3:47 pm

Re: PDF: Fails with XSL-FO but succeeds with HTML5&CSS

Post by julien_lacour »

Hello Carl,

The best thing to do in this case is, as Greg said, to open the 'pdf/oxygen_dita_temp/topic.fo' file in Oxygen and validate it.
Then you can simply search for the same content in the original DITA Topic and see if something is wrong there.

Are you using the default DITA Map PDF - based on XSL-FO transformation?
If you are using any custom parameter, additional plugins/XSL style-sheets, try without them to see if the problem still occur.

Regards,
Julien
Carl
Posts: 102
Joined: Fri Oct 19, 2018 2:19 am

Re: PDF: Fails with XSL-FO but succeeds with HTML5&CSS

Post by Carl »

Thanks for the feedback, Greg and Julien.

I use the default XSL-FO transformation with a few slight tweaks. I'll try the troubleshooting tip. In the meanwhile, I went back to another project with a known history of PDF'ing properly and was able to get my new outline to PDF.
Post Reply