prime
prime

Reputation: 799

Validate FO file

I generated a FO file from given xsl file and given xml file. I want to validate the FO file using a java code. When generating the fo file from xml and xsl, is it automatically checked?

Upvotes: 2

Views: 3431

Answers (2)

malat
malat

Reputation: 12490

I would still give focheck a try, see here:

As explained in the README:

Standalone

You can use the Relax NG schema in the schema folder and the Schematron files in the schematron folder outside of oXygen and Ant. However:

The Relax NG works with Jing and with Emacs nxml-mode but not with xmllint. The Schematron requires an XSLT 2.0 binding and a Schematron implementation that will both match on attributes as contexts as well as import and use external XSLT 2.0 stylesheets. Standalone checking requires Saxon 9 and Jing. You can get Jing from https://github.com/relaxng/jing-trang/releases.

Also if you using fop, please note that it comes with an unofficial FOP Schema, see here:

FOP also maintains an Unofficial FOP Schema in the FOP Subversion Repository. This document can be used either to validate against the FO standard, or against the actual FOP implementation. See the notes near the beginning of the document for instructions on how to use it.

Upvotes: 1

Hobbes
Hobbes

Reputation: 2115

I don't think so. The first indication I get that anyting's wrong with the FO is when the FO processor gives an error during PDF generation. One of the developers of Oxygen has this to say about the matter on the Oxygen forum:

The problem with XSL-FO is that there is no tool which can fully and properly validate it. An XML Schema cannot specify all constraints which are in an XSL-FO output file and there is no official XML Schema for validating XSL-FO output. Besides this, some XSL-FO processors like RenderX XEP have their own extensions to the standard. The best validation for me is to process the XSL-FO to PDF and thus let the processor issue warnings and errors as they are encountered.

Upvotes: 4

Related Questions