【问题标题】:Replace the image name in img src tag in XSL替换 XSL 中 img src 标记中的图像名称
【发布时间】:2013-09-23 08:11:11
【问题描述】:

我想用“string[1]”替换“Test.png”...例如“Test.png”=>“Fail.png”...

如何在 XSL 中做到这一点?

 <xsl:when test="string[1] = 'Fail'">
     <td> <a href="http://www.google.com/"><img src="Test.png" height="182" width="182"></img></a></td>
 </xsl:when>
<xsl:otherwise>
      <td> </td>
  </xsl:otherwise>
</xsl:choose>

谢谢, 穆图·塞尔万 SR

【问题讨论】:

    标签: image xslt replace src


    【解决方案1】:

    使用 attribute value template:src="{string[1]}.png"

    样式表中文字结果元素中的单个属性规范可以具有任意数量的属性值模板。每个都被视为&lt;xsl:value-of&gt;。

    【讨论】:

      猜你喜欢
      • 2012-01-05
      • 2022-01-23
      • 1970-01-01
      • 1970-01-01
      • 2011-06-09
      • 1970-01-01
      • 2021-12-18
      • 2021-12-26
      • 1970-01-01
      相关资源
      最近更新 更多