我在尝试使用when test=...
.
当我输出$tcbrand
它时,它会输出,'Direct'
但是当我对其进行操作时,它会返回false
并击中 else 块。我究竟做错了什么?
<fo:static-content flow-name="header-normal" font-size="10pt">
<xsl:variable name="tcbrand" select="smf:entity[@type='d2501b79-f888-4aa8-9fcf-a667a4c47c84']"/>
<fo:block font-size="10pt" text-align="left">
<fo:inline font-weight="normal">Brand: <xsl:value-of select="$tcbrand"/></fo:inline>
</fo:block>
<xsl:choose>
<!--<xsl:if test="$image = 'hello' ">-->
<xsl:when test="string($tcbrand)='Direct'">
<fo:block text-align="right" space-before="0mm">
<fo:external-graphic src="url('C:\Program Files (x86)\numerointeractive\whitemail\Images\18-30.png')" />
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block text-align="right" space-before="0mm">
<fo:external-graphic src="url('C:\Program Files (x86)\numerointeractive\whitemail\Images\ecom2.jpg')" />
</fo:block>
</xsl:otherwise>
</xsl:choose>
这是生成的 xml,我正在对其进行操作:
<smf:entity id="48659" type="d2501b79-f888-4aa8-9fcf-a667a4c47c84" confidence="1.0" author="2e0b99b3-9cba-4736-a59b-fe00b5f62871" validated="true" preferred="false" requiresComponentExtraction="false" changeTime="2012-11-26T14:47:28.840Z" nonPersistedId="false" modified="false">
<smf:value>Direct</smf:value>
</smf:entity>