<a href="{$videoId}">{$videoId}</a>
Here you should use <xsl:value-of select="$videoId"/> :
<a href="{$videoId}"><xsl:value-of select="$videoId"/></a>
Whenever you use AVT ( {$videoId} ) inside an attribute value, it should work with the exception of any select attribute.
In the latter case, you can use:
<xsl:value-of select="/macro/*[name()=$videoId]" />
When all this is reflected in your transformation, it works in all cases :
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:YouTube="urn:YouTube" xmlns:umbraco.library="urn:umbraco.library" exclude-result-prefixes="msxml umbraco.library YouTube"> <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:param name="videoId" select="'XXX'"/> <xsl:template match="/"> <a href="{$videoId}"><xsl:value-of select="$videoId"/></a> <object width="425" height="355"> <param name="movie" value="http://www.youtube.com/v/{$videoId}&hl=en"></param> <param name="wmode" value="transparent"></param> <embed src="http://www.youtube.com/v/{$videoId}&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed> </object><xsl:value-of select="concat($videoId, ' ', $videoId, ' ', $videoId)"/> <xsl:value-of select="/macro/*[name()=$videoId]" /> </xsl:template> </xsl:stylesheet>
source share