2013-09-22 54 views
0

我想用“string [1]”替换“Test.png”...例子“Test.png”=>“Fail.png”...用XSL替换img src标记中的图像名称

如何在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> 

谢谢, MUTHU Selvan SR

回答

1

使用attribute value templatesrc="{string[1]}.png"

在样式表中的一个文字结果元素的单个属性规范可以具有任何数量的属性的价值模板。每个都被视为<xsl:value-of>