Fop whitespace issue

Here should go questions about transforming XML with XSLT and FOP.
bridgji
Posts: 2
Joined: Wed Apr 30, 2008 8:09 pm

Fop whitespace issue

Post by bridgji »

I'm trying to upgrade to fop 0.93 or 0.94 from 0.20.5. When I run my fo xml through fop I get an issue with white space collapsing. Anyone see what I'm doing wrong? I've gone no wrap / white space mad in the example trying to find if it would help by placing it everywhere in the code.

Thanks

Jim


<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="only" white-space-collapse="false" white-space="nowrap">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="only" wrap-option="no-wrap" white-space-collapse="false" white-space="nowrap">
<fo:flow flow-name="xsl-region-body" wrap-option="no-wrap" white-space-collapse="false" white-space="nowrap">
<fo:block white-space-collapse="false" wrap-option="no-wrap" white-space="nowrap">

<fo:table table-layout="fixed" width="100%" white-space-collapse="false" wrap-option="no-wrap" white-space="nowrap">
<fo:table-column column-width=" proportional-column-width(132) " white-space-collapse="false" wrap-option="no-wrap" white-space="nowrap"/>
<fo:table-body >
<fo:table-row white-space-collapse="false" wrap-option="no-wrap" white-space="nowrap">
<fo:table-cell border-color="black" border-style="none" white-space-collapse="false" white-space="nowrap" wrap-option="no-wrap">
<fo:block wrap-option="no-wrap" white-space-collapse="false" white-space="nowrap">1 EMPLOYEES CURRENT TAX CURR EARNINGS </fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:table table-layout="fixed" width="100%" wrap-option="no-wrap" white-space="normal" white-space-collapse="false">
<fo:table-column column-width=" proportional-column-width(132) " wrap-option="no-wrap" white-space="normal" white-space-collapse="false"/>
<fo:table-body>
<fo:table-row height="9pt" wrap-option="no-wrap" white-space="normal" white-space-collapse="false">
<fo:table-cell border-color="black" border-style="none" overflow="hidden" wrap-option="no-wrap" white-space="normal" white-space-collapse="false">
<fo:block wrap-option="no-wrap" font-size="11.1pt" font-family="Courier" line-height="2pt" white-space="normal" white-space-collapse="false"> _________ _____________ _____________ </fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block></fo:flow></fo:page-sequence>

</fo:root>
Radu
Posts: 9439
Joined: Fri Jul 09, 2004 5:18 pm

Re: Fop whitespace issue

Post by Radu »

Dear Jim,

I opened the FO file in Oxygen and tried to validate it.
The "simple-page-master" element should not have the "white-space-collapse" and "white-space" attributes specified on it according to the FO XSD schema.

I enabled the output of the Apache FOP in Oxygen and then tried transforming the FO file to PDF using the 0.94 Apache FOP which comes which Oxygen both in the original form that you sent and after stripping all the "white-space-collapse", "white-space" and "wrap-option" attributes and still no warning received from the Apache FOP.

When transforming FO to PDF with Apache Oxygen executes a command line like this:

Code: Select all


java -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -javax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -cp "lib\xercesImpl.jar;lib\fop.jar;lib\avalon-framework-4.2.0.jar;lib\batik-all-1.6.jar;lib\commons-io-1.3.1.jar;xmlgraphics-commons-1.2.jar;lib\commons-logging-1.0.4.jar;lib\saxon9.jar;lib\saxon9-dom.jar;lib\xalan.jar;lib\serializerOxygen.jar" org.apache.fop.cli.Main -fo a.fo -pdf a.pdf
Many of the classpath libraries are probably not needed by you (used to render SVG images to PDF and so on)

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply