On Mon, Jul 05, 2010 at 09:27:06PM -0700, Alan Wang wrote:
> Hi All,
> I am writing a program similar to pdf output plugin to convert xdoc pages in
> xml document ( xdoc similar to http://xmlgraphics.apache.org/fop/index.xml),
> and would like to generate the pdf output using fop (0.95 on Mac os 10.5) as
> shown in the following.  However I am getting the following errors from
> console.
> (Location of error unknown)org.apache.fop.fo.ValidationException:
> Error(Unknown location): For fo:simple-page-master, fo:region-body must be
> declared before fo:region-before.
> 1. Where can I find the xsl to convert from xdoc to fo. I find one from
> apache forrest
> distribution( 
> apache-forrest-0.8/main/webapp/skins/common/xslt/fo/document-to-fo.xsl)?
> Or Am I using the wrong one for converting from xdoc to fo?

It would take extra steps to use that stylesheet for what you are
trying to accomplish. The stylesheet is not general purpose; that is,
it's part of the following process:

1) skinconf.xml (from the Forrest skin system) is aggregated with the
requested document
2) XInclude elements are processed
3) Links are rewritten
4) Then the document as modified above is passed through
document-to-fo.xsl, with a few more parameters set

To make document-to-fo.xsl a standalone tool, you would need to manage
steps 1-3 yourself. Or drastically modify the stylesheet.


> 2. Is anything wrong with my code?
> Regards,
> Alan