Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Links in XSL file

Status
Not open for further replies.

cmhunt

Programmer
Apr 17, 2001
119
GB
I currently have the following code in an XSL file which lists a the countries from an XML file:
Code:
<table align=&quot;center&quot; cellpadding=&quot;5&quot; border=&quot;1&quot; >
<xsl:for-each select=&quot;file/record&quot;> 
<tr>
<td>
<xsl:value-of select=&quot;country&quot; /> 
</td>
</tr>
</xsl:for-each>
</table>
All I want to do is create a link to a file the same name as the country when clicking on the country name. I am new to XSL files and am sure this can't be hard but I can't find any example of it. Thanks!!
 
Code:
<table align=&quot;center&quot; cellpadding=&quot;5&quot; border=&quot;1&quot; >
<xsl:for-each select=&quot;file/record&quot;> 
<tr>
<td>
<a>
<xsl:attribute name=&quot;href&quot;>
   <xsl:value-of select=&quot;filename&quot;/>
</xsl:attribute>
<xsl:value-of select=&quot;country&quot; />
</a>
</td>
</tr>
</xsl:for-each>
</table>

Of course you have to include the &quot;filename&quot; node in your xml as a child of each record node.

Jordi Reineman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top