Your <xsl:variable> instruction CANNOT go INSIDE the <xsl:for-each> instruction, otherwise it will not exist once you get out of it.
Imagine in a C# program if you wrote the following:
Code:
function Method1()
{
int i = 10;
Method2();
}
function Method2()
{
Console.WriteLine("i = " + i); // This will not compile - i does not exist in Method2().
}
The same is true in XSLT - if you declare the variable inside the <xsl:for-each> instruction it doesn't exist anywhere apart from inside that instruction.
Code:
<xsl:for-each>
...
</xsl:for-each>
<xsl:variable name="VenEx" select="Activity/ObjectGroup[@type='default']/Object[@name='VE10IntVendorFields']/Attributes/Attribute[@name='visible']"/>
<xsl:if test="$VenEx = 'True'">
<table>
...
</table>
</xsl:if>
Also, and we have mentioned this more than once now -
please try to paste your code so that it retains the spaces in your XML markup - trying to read or test your code is hard enough as it is without the extra work.