[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 512
  • Last Modified:

Stylesheet for xhtml to fo with fop.jar


Does anyone know of an xslt stylesheet that will convert xhtml to fo.  I'm using the fo transformation associated with the apache fop.jar.  I've tried the xhtml2fo.xls at http://www.antennahouse.com/XSLsample/XSLsample.htm, but get a ClassCastException (at org.apache.fop.fo.flow.BlockContainer.layout(BlockContainer.java:157)).  I notice a disclaimer in xhtml2fo.xls - "Since this stylesheet is originally developed by Antenna House to be used with XSL Formatter, it may not be compatible with another XSL-FO processors."

Thx.

jkavx
0
jkavx
Asked:
jkavx
  • 2
  • 2
1 Solution
 
aozarovCommented:
That link contains more the one XSL to convert XHTML to FO. none of them worked for you? W3C-REC.xsl ?
0
 
jkavxAuthor Commented:

All of these files use xhtml2fo.xsl:

  <xsl:import href="xhtml2fo.xsl"/>

I'm getting the same error with W3C-REL.xsl:
ClassCastException (at org.apache.fop.fo.flow.BlockContainer.layout(BlockContainer.java:157)).  
0
 
aozarovCommented:
There is a bug reported against Apache FO -> http://www.mail-archive.com/fop-dev@xml.apache.org/msg13828.html
0
 
jkavxAuthor Commented:

I've been able to work around this, by eliminating the xsl use of fo:block-container.

The main problem I now have is that this stylesheet is meant to be used with the Antenna House XSL Formatter, which seems to handle fo:table table-layout="auto".  The Apache Fo formatter only works with fo:table table-layout="fixed", which will require some reworking of xhtml2fo.xsl.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now