I have a following XML file:
Patterns in XSLT 1.0 are not allowed to contain variable or parameter references so you couldn't use variable or parameter references in those key definitions or in the template match attributes you have.