0
「Artproof」變量爲true。 我想改變文字的顏色,如果變量爲真在XLST中聲明和初始化變量
<xsl:variable name="ArtProof" select="'True'"/>
<xsl:choose>
<xsl:when test="$ArtProof = 'True'">
<xsl:variable name="color_of_artproof" select="'green'"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="color_of_artproof" select="'red'"/>
</xsl:otherwise>
</xsl:choose>
設置顏色的條件是:
「color_of_artproof」變量賦予空值,和文字是黑色。