开发者

Generating output from XML and CSS with docbook - working for HTML, failing for PDF

Starting from a series of xml files and a stylesheet I generate a HTML file using docbook-xsl-ns-1.73, libxslt-1.1.22.win32 and fop-0.94. the stylesheet says that code chunks must have numbered lines and a gray background. here is the piece of the and task that converts xmls to html:

<exec executable="${XSLTPROC_EXECUTABLE}">
     <arg value="--output" />
     <arg value="${target.html.dir}/${book}_toc.xml" />

     <arg value="--xinclude" />

     <arg value="--param" />
     <arg value="html.stylesheet" />
     <arg value="'css/visixd-docbook.css'" />

     <arg value="--param" />         
     <arg value="chunk.separate.lots" />
     <arg value="1" />

     <arg value="--param" />         
     <arg value="chunk.first.sections" />
     <arg value="1" />

     <arg value="--param" />
     <arg value="chunk.section.depth" />
     <arg value="8" />

     <arg value="--param" />         
     <arg value="toc.section.depth" />
     <arg value="3" />

     <arg value="--param" />         
     <arg value="navig.graphics" />
     <arg value="1" />

     <arg value="--param" />         
     <arg value="ignore.image.scaling" />
     <arg value="1" />

     <arg value="src/reusable/xsl/makeCustomToc.xsl" />
     <arg value="src/workspace/${book}/${language}/${book}.xml" />
    </exec> 

now this task works perfectly fine, producing the desired output.

the similar task used for converting xmls to pdf has these parameters:

<exec executable="${XSLTPROC_EXECUTABLE}">
     <arg value="--output" />
     <arg 开发者_StackOverflowvalue="${target.fo.dir}/${book}.fo" />

     <arg value="--param" />
     <arg value="paper.type" />
     <arg value="'USletter'" />         

     <arg value="--param" />
     <arg value="img.src.path" />
     <arg value="'src/workspace/${book}/${language}/'" />

     <arg value="--param" />
     <arg value="fop.extensions" />
     <arg value="0" />

     <arg value="--param" />
     <arg value="fop1.extensions" />
     <arg value="1" />

     <arg value="--param" />
     <arg value="pdf.stylesheet" />
     <arg value="'css/visixd-docbook.css'" />

     <arg value="--xinclude" />

     <arg value="--param" />         
     <arg value="chunk.separate.lots" />
     <arg value="1" />

     <arg value="--param" />         
     <arg value="chunk.first.sections" />
     <arg value="1" />

     <arg value="--param" />
     <arg value="chunk.section.depth" />
     <arg value="8" />

     <arg value="--param" />         
     <arg value="toc.section.depth" />
     <arg value="3" />

     <arg value="${DOCBOOK_XSL_HOME}/fo/docbook.xsl" />
     <arg value="src/workspace/${book}/${language}/${book}.xml" />
    </exec>

the problem is my ant task for pdf conversion fails to format code lines as stated in the stylesheet. what can be wrong? considering that the conversion to html uses the same stylesheet and works. where should i look for a solution? thanks in advance.


You are trying to format FO/PDF output using CSS. That does not work.

The stock DocBook XSL stylesheets do not have a parameter called pdf.stylesheet. And the chunk.* parameters are for HTML output only.

What do you mean by "code chunks" and "code lines"? Do you mean <programlisting> elements in the XML source?

You should consult the definitive reference for using DocBook XSL: http://www.sagehill.net/docbookxsl/index.html.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜