The error message is pretty clear. Variables and parameters have a scope in XSLT depending on where they are declared. In general there's "template" scope and "file scope".
A variable only exists and is scoped to he template in which it was declared. So if you have a situation like the following, you're fine. The variables "VarName" are completely different variables because they are declared in separate templates. In the "something" template the variables value is 1, in the "something else" template the variables value is 2. They are basically, completely different varibales that have the same name.
<xsl:template match="something">
<xsl:variable name="VarName" select="'1'" />
</xsl:template>
<xsl:template match="somethingelse" >
<xsl:variable name="VarName" select="'2'" />
</xsl:template>
The other scope is across files. Each file that is brought into a xslt using xsl:include has a scope of the file itself. So if you declare 2 variables, that happen to have the same name in 2 separate files, that's ok as well. The scope of each variable is only the FILE which it is declared.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="VarName" select="'1'" />
</xsl:stylesheet>
<!-- Stylesheet B -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="VarName" select="'2'" />
</xsl:stylesheet>
What you can't do, is declare the same variable TWICE in the same scope. So either of the following situations is wrong. What is the value of "VarName" in each of these transformations? 1 or 2? For that scope, the variable is declared twice.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Conflict -->
<xsl:variable name="VarName" select="'1'" />
<xsl:variable name="VarName" select="'2'" />
</xsl:stylesheet>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="something" >
<!-- Conflict -->
<xsl:variable name="VarName" select="'1'" />
<xsl:variable name="VarName" select="'2'" />
</xsl:template>
</xsl:stylesheet> Here's the catch. If you do the wrong way, and there is a conflict of variables. Some XSLT processors will handle it differently. Some might ignore one of the declarations and execute (it just picks one, but you don't know which). some might be more strict and while it's compiling say, "Sorry you can't declare this twice, so I'm going to fail to run", which is what yours is doing.
Either way, it's really bad coding to do that. Without seeing it and debugging it myself I can't give you the true root cause. But, I'd likely say that this XSLT basically broken, and you're going to have to resolve all those conflicts before it functions.