xml - 使用动态 URL 添加带有 XSL :FO 的图片

标签 xml xslt xsl-fo

我想在我的 PDF 输出中添加图像。问题是,

<fo:external-graphic src="url('URL here')"/>

只接受一个 URL。然而,指向我要添加的图像的链接是从正在转换的 XML 文档中的另一个值派生的。

有什么方法可以动态生成图片网址吗?

提前致谢 塞巴斯蒂安

最佳答案

使用Attribute Value Template

An attribute value template consists of an alternating sequence of fixed parts and variable parts. A variable part consists of an XPath expression enclosed in curly brackets ({}). A fixed part may contain any characters, except that a left curly bracket must be written as {{ and a right curly bracket must be written as }}.

关于xml - 使用动态 URL 添加带有 XSL :FO 的图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3924904/

相关文章:

Python无法识别环境变量

regex - 是否可以将正则表达式直接放入 XML 内容中?

xml - XSLT默认模板模式?

带有位图标记的 Android XML 可绘制圆角

尝试匹配另一个元素的同级元素之后的 XSLT 错误

javascript - 如何使用一个 XSLT 文件中的变量到另一个 XSLT 文件

XSL-FO 分页符取决于上一页的完整性

image - 缩小以适合FOP中的图像

javascript - 从 JQuery 函数返回 html。

c# - 通过导入将 XSD 转换为 XML