добрый день. проблема в следующем.
использую конвертер html в fo html2fo
конвертирую файл http://html2fo.sourceforge.net/testsuite/table.html при помощи команды html2fo table.html table.fo - все ок, файл table.fo создается, аналогично как и в примере http://html2fo.sourceforge.net/testsuite/table.fo.
после этого пытаюсь перегнать его в pdf,используя
fop -fo table.fo -pdf table.pdfи в ответ получаю
fop -fo table.fo -pdf table.pdf
15.04.2008 11:13:59 org.apache.fop.cli.Main startFOP
SEVERE: Exception
javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: file:///tmp/test/table.fo:6:38: Error(6/38): For fo:simple-page-master, fo:region-body must be declared before fo:region-before.
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)---------
javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: file:///tmp/test/table.fo:6:38: Error(6/38): For fo:simple-page-master, fo:region-body must be declared before fo:region-before.
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:501)
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)
Caused by: org.apache.fop.fo.ValidationException: file:///tmp/test/table.fo:6:38: Error(6/38): For fo:simple-page-master, fo:region-body must be declared before fo:region-before.
at org.apache.fop.fo.FONode.nodesOutOfOrderError(FONode.java:382)
at org.apache.fop.fo.pagination.SimplePageMaster.validateChildNode(SimplePageMaster.java:129)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:302)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
... 4 more
---------
org.apache.fop.fo.ValidationException: file:///tmp/test/table.fo:6:38: Error(6/38): For fo:simple-page-master, fo:region-body must be declared before fo:region-before.
at org.apache.fop.fo.FONode.nodesOutOfOrderError(FONode.java:382)
at org.apache.fop.fo.pagination.SimplePageMaster.validateChildNode(SimplePageMaster.java:129)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:302)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)
//
естественно файл pdf не создается.
операционная система freeBSD 6.2
html2fo-0.4.2
fop-0.94
спасибо
Привет!Покажи свой table.fo для начала.
>Привет!
>
>Покажи свой table.fo для начала.вот. p.s. писал разработчикам, но что-то ноль ответа.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xml.apache.org/fop/extensions">
<!-- Creator="html2fo" Version="0.4.2" -->
<fo:layout-master-set>
<fo:simple-page-master margin-right="2.0cm" margin-left="2.0cm" margin-bottom="1.0cm" margin-top="1.0cm" page-width="21cm" page-height="29.7cm" master-name="first">
<fo:region-before extent="1.5cm"/>
<fo:region-body margin-bottom="1.5cm" margin-top="1.5cm"/>
<fo:region-after extent="1.0cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="first" language="de" hyphenate="true">
<fo:static-content flow-name="xsl-region-before">
<fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">Table Test Page</fo:block></fo:static-content><fo:static-content flow-name="xsl-region-after">
<fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always"></fo:block><fo:block line-height="12pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always"><fo:inline font-size="10pt">Page </fo:inline><fo:inline font-size="10pt"><fo:page-number></fo:page-number></fo:inline><fo:inline font-size="10pt"> of </fo:inline><fo:inline font-size="10pt"><fo:page-number-citation ref-id="LastPage"></fo:page-number-citation></fo:inline></fo:block></fo:static-content><fo:flow flow-name="xsl-region-body">
<fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">This is an example page with a table with col- and rowspans.</fo:block>
<fo:table text-align="left" table-layout="fixed">
<fo:table-column column-width="1.35cm"/>
<fo:table-column column-width="1.34cm"/>
<fo:table-column column-width="1.35cm"/>
<fo:table-column column-width="1.35cm"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border-style="solid" border-color="black" border-width="1pt"
><fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">1;1 1x1</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" border-color="black" border-width="1pt"
number-columns-spanned="2">
<fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">1;2 1x2</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" border-color="black" border-width="1pt"
number-rows-spanned="3">
<fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">1;4 3x1</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-style="solid" border-color="black" border-width="1pt"
number-rows-spanned="2" number-columns-spanned="2">
<fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">2;1 2x2</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" border-color="black" border-width="1pt"
><fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">2;3 1x1</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-style="solid" border-color="black" border-width="1pt"
><fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">3;3 1x1</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body></fo:table>
<fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">This is an empty example table tag</fo:block>
<fo:table text-align="left" table-layout="fixed">
<fo:table-column column-width="16.30cm"/>
<fo:table-body><fo:table-row><fo:table-cell border-style="solid" border-color="black" border-width="1pt"></fo:table-cell></fo:table-row></fo:table-body></fo:table>
<fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">This is an example table with an empty row tag.</fo:block>
<fo:table text-align="left" table-layout="fixed">
<fo:table-column column-width="16.30cm"/>
<fo:table-body><fo:table-row><fo:table-cell border-style="solid" border-color="black" border-width="1pt"></fo:table-cell></fo:table-row></fo:table-body></fo:table>
<fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">This is an example table with an empty cell tag.</fo:block>
<fo:table text-align="left" table-layout="fixed">
<fo:table-column column-width="16.30cm"/>
<fo:table-body><fo:table-row><fo:table-cell border-style="solid" border-color="black" border-width="1pt"><fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always"><fo:inline white-space-collapse="false"> </fo:inline></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table>
<fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">This is an example table with an empty cell tag and another empty row</fo:block>
<fo:table text-align="left" table-layout="fixed">
<fo:table-column column-width="16.30cm"/>
<fo:table-body><fo:table-row><fo:table-cell border-style="solid" border-color="black" border-width="1pt"><fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always"><fo:inline white-space-collapse="false"> </fo:inline></fo:block></fo:table-cell></fo:table-row><fo:table-row><fo:table-cell border-style="solid" border-color="black" border-width="1pt"></fo:table-cell></fo:table-row></fo:table-body></fo:table>
<fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">This is the last Paragraph of my test document</fo:block>
<fo:block space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always" id="LastPage" line-height="1pt" font-size="1pt"></fo:block></fo:flow>
</fo:page-sequence></fo:root>