我正试图将XML中的图像加载到XSLT中。
我正在使用XML1.0。
我找到了很多解决方案,但是我的XML还有另一个结构,所以我希望有人能帮上忙。
这是我的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中添加源代码吗?
为了所有的帮助!
发布于 2017-02-06 19:12:13
只需匹配每一幅画:
<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>https://stackoverflow.com/questions/42073524
复制相似问题