title: Hyperlinking to same document with generate-id()
body: <p>I'm trying to create links to the same document with my XML and XSLT. I'm trying to use generate-id() to create an index then anchors for the respective items.</p>
  
  <p>problem is, the element name is not the same in the XML but i wish to link to it.</p>
  
  <p>for example</p>
  
  <p>XML:</p>
  
  <pre><code>  &lt;testresults&gt;
        &lt;test testname="ComparisonResult"&gt;
          &lt;step stepname="Step1"&gt;
            &lt;result&gt;true&lt;/result&gt;
          &lt;/step&gt;
          &lt;step stepname="Step2" &gt;
            &lt;result&gt;true&lt;/result&gt;
          &lt;/step&gt;
        &lt;/test&gt;
        &lt;step stepname="results" stepresult="true"&gt;
          &lt;drilldown&gt;
            &lt;taskresults&gt;
              &lt;testResults&gt;
                &lt;test testname="ComparisonResult_Step1"&gt;
  
                &lt;/test&gt;
                &lt;test testname="ComparisonResult_Step2"&gt;
  
                &lt;/test&gt;
              &lt;/testResults&gt;
            &lt;/taskresults&gt;
          &lt;/drilldown&gt;
        &lt;/step&gt;
  
      &lt;/testresults&gt;
  </code></pre>
  
  <p>XSLT:</p>
  
  <pre><code>   &lt;?xml version="1.0" encoding="UTF-8" ?&gt;
      &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
        &lt;xsl:template match="/"&gt;
          &lt;html&gt;
            &lt;body&gt;
              &lt;font face="Arial" size="2"&gt;
  
              &lt;h4&gt;Steps&lt;/h4&gt;
  
  
        &lt;table border="1" bordercolor="#000000"&gt;
                    &lt;tr bgcolor="#dccdc"&gt;
                      &lt;th align="center"&gt;Task&lt;/th&gt;
                    &lt;/tr&gt;
  
          &lt;xsl:for-each select="testresults/test/step"&gt;
                      &lt;tr&gt;
                        &lt;td bgcolor="#F2F5A9"&gt;                  
                          &lt;a href="#{generate-id(@stepname)}"&gt;
                          &lt;xsl:value-of select="@stepname" /&gt;
                          &lt;/a&gt;                    
                        &lt;/td&gt;                   
  
                      &lt;/tr&gt;       
                      &lt;/xsl:for-each&gt;             
                      &lt;/table&gt;
  
                &lt;h2&gt;Test Results&lt;/h2&gt;  
  
                    &lt;xsl:for-each select="testresults/step/drilldown/taskresults/testResults/test"&gt;
  
                  &lt;h3&gt;
                  &lt;a name="{generate-id(@testname)}"&gt;
                    &lt;xsl:value-of select="@testname" /&gt;
                    &lt;/a&gt;
                  &lt;/h3&gt;
  
                  &lt;/xsl:for-each&gt;
  
                  &lt;/xsl:template&gt;
  
      &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Please ignore any mistakes, this is a quick mockup but you should get an idea of what im trying to do. I can't get it to link to the corresponding item. I.e Step1 to ComparisonResult_Step1.</p>
  
  <p>Any ideas</p>