我需要知道变量$transformed_date是否每次都会被评估,或者这个变量是否与变量影响一样好(如在 C、Java 等中)。我想确保我不会一遍又一遍地重新评估同一件事。
<xsl:variable name="transformed_date" select="adjust-dateTime-to-timezone(xs:dateTime(concat(substring ($original_date, 1, 4),'-',substring ($original_date, 5, 2),'-',substring ($original_date, 7, 2),'T',substring ($original_date, 9, 2),':',substring ($original_date, 11, 2),':',substring ($original_date, 13, 2),'-00:00')), xs:dayTimeDuration('-PT5H'))"/>
<xsl:choose>
<xsl:when test="substring (xs:string($transformed_date), 6, 2) = '01'">
<fo:inline>
Jan.
</fo:inline>
</xsl:when>
<xsl:when test="substring (xs:string($transformed_date), 6, 2) = '02'">
<fo:inline>
Feb.
</fo:inline>
</xsl:when>
...