xsl gets attributes with dollar as php variable
===

my xsl stylesheet just works fine except the thing that i cant use attributes in my stylesheet. But i really need them to complete my function.

I'm using the xsl in php and when i try to declare an attribute and use <xsl:value-of select="$attr"/>, the xsl thinks that $attr is a php variable and the function crashes.

This is my code

    <?php
    function releaseNotes($source, $type, $order_by, $sort) {
    
    $type = $type ? "[@type='{$type}']" : "";
    
    $xsl = <<<XSL
    <?xml version="1.0" encoding="iso-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:key name="versions" match="issue" use="fix_versions"/>
    <xsl:key name="type" match="issue" use="concat(fix_versions, '+', @type)"/>
    
      <xsl:template match="issues">
      
      
      
          <xsl:for-each select="//issue[generate-id(.)=generate-id(key('versions', fix_versions)[1])]">
          
            <xsl:sort select="fix_versions" order="descending"/> 
            
            <div class="release">
            
            	<a href="" class="version"><xsl:value-of select="fix_versions"/></a>
            	
            	<div class="version" style="display:none;">
            	
            	<xsl:for-each select="key('versions', fix_versions)[generate-id() = generate-id(key('type', concat(fix_versions, '+', @type))[1])]">
    						<div class="types">
    							<a href="" class="type"><xsl:value-of select="@type"/>s</a>
    							<div class="type" style="display:none">
                	<xsl:for-each select="key('type', concat(fix_versions, '+', @type))">
                		<div style="border-bottom:1px solid grey;">
                  		<a href="" class="title"><xsl:value-of select="title"/></a>
                  		<div class="toggle" style="display:none;">
                  			<xsl:value-of select="description"/>
                  		</div>
                		</div>
    							</xsl:for-each>
    							</div>
    						</div>						
            	</xsl:for-each>
            
            	</div>
           </div>
          </xsl:for-each>
      </xsl:template>
    
    </xsl:stylesheet>
    XSL;
    
    $xmldoc = new DOMDocument('1.0', 'utf-8');
    $xmldoc->load($source);
    $xsldoc = DOMDocument::loadXML($xsl);
    
    $proc = new XSLTProcessor();
    $proc->registerPHPFunctions();
    $proc->importStyleSheet($xsldoc);
    return $proc->transformToXML($xmldoc);
    }
    ?>  

No matter where i try to use an attribute - as soon as i want to use it, i get no result of the function anymore? Any idea? 

Thanks in advance