1

I'm trying to use XML Calabash 1.0.23 to run XSLT transformation and FO formatting in a single pipeline. Although the XSLT step works fine, I cannot get the xsl-formatter step to work with FOP.

Every time I run the pipeline, Calabash throws:

ERROR: pipeline.xpl:13:68:Failed to instantiate FO provider
ERROR: Underlying exception: org/apache/fop/apps/FopFactory

My call to Calabash from the command line is:

java com.xmlcalabash.drivers.Main -c cfg.xml myPipeline.xpl

And the cfg.xml configuration file being referred to in the above line is:

<cc:xproc-config xmlns:cc="http://xmlcalabash.com/ns/configuration">
  <cc:fo-processor class-name="com.xmlcalabash.util.FoFOP"/>
</cc:xproc-config>

For some reason, Calabash seems to ignore the config file setting, because regardless of the value of the class-name attribute on <cc:fo-processor>, it always throws the same error message. For example, if I use com.xmlcalabash.util.FoAH, the same happens; and if put a nonsensical value, the same occurs. It's always an exception on org/apache/fop/apps/FopFactory.

Just for the sake of completeness, this is my XPL:

<declare-step name="main" version="1.0" xmlns="http://www.w3.org/ns/xproc">
  <input port="parameters" kind="parameter" />
  <xslt name="transformation">
    <input port="source">
      <document href="myMarkup.xml" />
    </input>
    <input port="stylesheet">
      <document href="myStylesheet.xsl" />
    </input>
  </xslt>
  <xsl-formatter href="newDoc.pdf" >
    <input port="source">
      <pipe step="transformation" port="result" />
    </input>
  </xsl-formatter>
</declare-step>

Of course, if I manually pass the generated FO from the XSLT step to FOP 1.1, it converts it to PDF with no problems. The issue only arises when trying to do the conversion within the pipeline.

I could really use some help to solve this. I'm clueless at this point.

4

1 回答 1

1

这似乎是一个非常迂腐的回答,但是您的类路径中有 fop.jar(和我认为 FOP 需要的 fop-hyph.jar)吗?它们没有捆绑在 XML Calabash 发行版中,您必须从 Apache 获取它们。

于 2015-02-06T15:44:10.017 回答