<xsl:for-each select="E1EDL37[VHILM='RFID_PALL']">
<xsl:variable name="RFIDPALLET" select='YES'/>
</xsl:for-each>
This doesn't work because the variable goes out of scope as soon as the xsl:for-each exits. You can set a boolean variable like this:
<xsl:variable name="RFIDPALLET" select="boolean(E1EDL37[VHILM='RFID_PALL'])"/>
and then test it using
xsl:when test="$RFIDPALLET"
But it would probably be better to have a variable containing the node-set itself:
<xsl:variable name="RFIDPALLET" select="E1EDL37[VHILM='RFID_PALL']"/>
and then do
<xsl:when test="$RFIDPALLET">
<xsl:for-each select="$RFIDPALLET">
remembering that tests when applied to a node-set return true if the node-set is non-empty.
Incidentally, don't do this:
<xsl:variable name="Case">
<xsl:value-of select="EXIDV" />
</xsl:variable>
when you mean
<xsl:variable name="Case" select="EXIDV" />
The latter form is a third the length and can be ten times faster, because it doesn't create any new nodes.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference