XSLT Error Reference

XTSE0630

All versions XSLT static error
Error message
Duplicate global variable declaration / Variable 'x' is multiply defined in the same scope

Two xsl:variable or xsl:param declarations with the same name exist at the same level — often caused by a stylesheet being included twice.

What it means

The stylesheet declares the same variable or parameter name twice at the same scope level with the same import precedence. The processor cannot decide which one wins, so compilation stops.

Common causes

  1. Literal duplicate — two <xsl:param name="input"/> or <xsl:variable name="config"/> at the top level, often after copy-pasting a block.
  2. The same file included twice. xsl:include pulls declarations in verbatim; if A includes B and C, and B also includes C, every global in C is declared twice. This is the sneaky version — each file looks correct on its own.
  3. Local duplicate in the same template — two xsl:variable with the same name as siblings (re-assignment does not exist in XSLT; variables are immutable).

How to fix it

  • Remove or rename one of the duplicates. If you were trying to update a variable: XSLT variables cannot be reassigned — compute the final value in one declaration, or use xsl:iterate/recursion for running state.
  • For diamond includes, switch to xsl:import (imported declarations get lower precedence, so an override is legal) or restructure so each module is included exactly once.
  • The error message includes the line number of the second declaration — start there.