I thought it would be <xsl:when test="focusedTab[@name='Login']"> but
it won't work.

It's likely that the context node when you call the named template
"scripts" is not <navigation> - either make the XPath absolute or
ensure the context node is the right one when you call the template.