我需要抓取几张图片,并将它们放到通过Apache FOP生成的pdf中。在eXist之外,我没有问题。使用eXist,模板无法正常工作,输出中没有图像 - 可能是路径存在问题。eXist-db - XSLT中的路径
的“文件”的结构是:
project/data/file.xml
project/data/img/*pictures.jpg
测试来源:
<figure>
<graphic url="img/tealover.jpg"/>
</figure>
<figure>
<graphic url="./img/tealover.jpg"/>
</figure>
<figure>
<graphic url="/db/apps/karolinum-apps/data/img/tealover.jpg"/>
</figure>
模板:
<xsl:template match="tei:figure/tei:graphic">
<fo:block>
<fo:external-graphic src="{@url}" xsl:use-attribute-sets="images"/>
</fo:block>
<xsl:apply-templates/>
</xsl:template>
哪里可能是问题?我是否错过了eXist的一些设置?在ePub制作期间收集图像时,这没有问题。
UPDATE
XSL-FO输出:
<fo:block>
<fo:external-graphic width="50%" content-height="100%" content-width="scale-to-fit" scaling="uniform" src="img/tealover.jpg"/>
</fo:block>
<fo:block>
<fo:external-graphic width="50%" content-height="100%" content-width="scale-to-fit" scaling="uniform" src="./img/tealover.jpg"/>
</fo:block>
<fo:block>
<fo:external-graphic width="50%" content-height="100%" content-width="scale-to-fit" scaling="uniform" src="/db/apps/karolinum-apps/data/img/tealover.jpg"/>
</fo:block>
你有办法检查创建的FO吗? src'属性是否为空? –
对于我来说,我试图弄清楚发生了什么,但它与源代码中的相同。我会再次确保。但我想这个问题可能在别的地方。 –