0
以下は私のコードです。基本的に、問題は、ノードをチェックする必要があることです。ノードが空白の場合は0に設定しますが、値がある場合はその値に設定します。その後、私はそれを計算する必要があります(値を引く)。以下は私が試したものですが、エラーが発生しています "可変パラメータ 'quantAvail'が定義されていないか、範囲外です。"私はそれを解決する方法がわからないのですか?ノードが空で、空の場合は値に設定してください
<xsl:choose>
<xsl:when test="quantitybackordered=''">
<xsl:variable name="quantBackOrdered" select="0"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="quantBackOrdered" select="quantitybackordered"/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="locationquantityavailable=''">
<xsl:variable name="quantAvail" select="0"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="quantAvail" select="locationquantityavailable"/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="inventoryLocation_internalid='18'">
<xsl:variable name="quantTotal" select="$quantAvail - $quantBackOrdered"/> <!-- Error on this line -->
<xsl:value-of select="$quantTotal"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="test" select="locationquantityavailable"/>
<xsl:choose>
<xsl:when test="$test=''">
<xsl:text>0</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="locationquantityavailable"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
ます。http:// stackoverflow.com/help/someone-answers –