2017-02-06 31 views
0

我想從我的XML加載圖像到我的XSLT。
我正在使用XML 1.0。
我發現了很多解決方案,但是我的XML有另一種構造,所以我希望有人能夠提供幫助。使用FOP將圖像從XML加載到XSLT Apache

這是我的XML:

<groundplan> 
    <drawing mime_type="image/png" url="./Pictures/drawing1.png"></drawing> 
    <drawing mime_type="image/png" url="./Pictures/drawing2.png"></drawing> 
</groundplan> 

XSLT:

<?xml version="1.0" encoding="ISO-8859-1"?>  
<fo:table-row> 
    <fo:table-cell> 
     <fo:block>     
      <fo:external-graphic content-height="33mm" content-width="190mm" scaling="non-uniform" src=""/> 
     </fo:block> 
    </fo:table-cell>   
</fo:table-row> 

<fo:table-row> 
    <fo:table-cell> 
     <fo:block>     
      <fo:external-graphic content-height="33mm" content-width="190mm" scaling="non-uniform" src=""/> 
     </fo:block> 
    </fo:table-cell>   
</fo:table-row> 

是否有可能從我的XML添加源?

Thx的所有幫助!

回答

0

只是相互匹配圖紙:

<xsl:template match="/groundplan/drawing"> 
    <fo:table-row> 
    <fo:table-cell> 
     <fo:block>     
      <fo:external-graphic content-height="33mm" content-width="190mm" scaling="non-uniform" src="{@url}"/> 
     </fo:block> 
    </fo:table-cell>   
    </fo:table-row> 
</xsl:template> 
+0

喂@stefanhegny不'噸爲我工作。嘗試生成PDF時遇到多個錯誤 – user3356007

+0

我認爲你的解決方案是有用的,但我有一個大的文件,這就是爲什麼這對我沒有用 – user3356007

+0

我看不出爲什麼它不應該爲大文件工作,也不會看到任何在所有的練習替代.. –