我需要抓取幾張圖片,並將它們放到通過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'屬性是否爲空? –
對於我來說,我試圖弄清楚發生了什麼,但它與源代碼中的相同。我會再次確保。但我想這個問題可能在別的地方。 –