Переменные находятся в блоке, в котором они объявлены, что означает, что в вашем случае они существуют только в блоках xsl:when
(и xsl:otherwise
) и недоступны вне этого.
Чтовы можете сделать это, поместив xsl:choose
внутрь xsl:variable
вместо
<xsl:template match="/">
<root>
<xsl:variable name="Con1">
<xsl:choose>
<xsl:when test="Request/Query/Parameter = 'DateiPfad'">2001</xsl:when>
<xsl:otherwise>2000</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="Con2">
<xsl:choose>
<xsl:when test="Request/Query/Parameter = 'DateiName'">2001</xsl:when>
<xsl:otherwise>2000</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$Con1 = 2001 and $Con2 = 2001">
<xsl:processing-instruction name="ConditionState">
2001
</xsl:processing-instruction>
</xsl:if>
<xsl:if test="$Con1 = 2000 and $Con2 = 2000">
<xsl:processing-instruction name="ConditionState">
2000
</xsl:processing-instruction>
</xsl:if>
</root>
</xsl:template>
Конечно, в приведенном вами примере вам на самом деле не нужен xsl:variable
вообще ...
<xsl:template match="/">
<root>
<xsl:if test="Request/Query/Parameter = 'DateiPfad' and Request/Query/Parameter = 'DateiName'">
<xsl:processing-instruction name="ConditionState">
2001
</xsl:processing-instruction>
</xsl:if>
<xsl:if test="not(Request/Query/Parameter = 'DateiPfad') and not(Request/Query/Parameter = 'DateiName')">
<xsl:processing-instruction name="ConditionState">
2000
</xsl:processing-instruction>
</xsl:if>
</root>
</xsl:template>