select="src" means select="child::src", it selects a child element of the context node. But within <xsl:template match="@src"> the context node is an attribute, and attributes don't have children. Perhaps you just want select=".". Actually I'm not sure why you want a variable at all, but you haven't show us all your logic presumably.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference