誰かが私が間違っていることを教えてもらえますか? <xsl:value-of select="string-length(add:Destinations/add:DestinationName)" />
= Sacramento、CAの場合、私は可変領域が西であると予想しますが、私は東になります。XSLT選択しないでください
<xsl:variable name="charCount">
<xsl:value-of select="string-length(add:Destinations/add:DestinationName)" />
</xsl:variable>
<xsl:variable name="amendedCharCount">
<xsl:value-of select="$charCount - 2"/>
</xsl:variable>
<xsl:variable name="state">
<xsl:value-of select="substring(add:Destinations/add:DestinationName,$amendedCharCount)"/>
</xsl:variable>
<xsl:variable name="region">
<xsl:choose>
<xsl:when test="$state='CA'">west</xsl:when>
<xsl:otherwise>east</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="OperationsRegion">
<xsl:value-of select="$region"/>
</xsl:element>
本当に入力XMLを質問に投稿してください。ありがとう。 –