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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to use image as hyperlink 1

Status
Not open for further replies.

tburrows

Technical User
Oct 3, 2003
49
0
0
US
I am trying to use an xml file that has 2 tags that are the name of a thumbnail jpg image and the other is for a large version of the thumbnail. The other tags are name, age, etc.

What I want to do is make a table with all the info on one person. One of the cells has the thumbnail and when you click on the thumbnail, the large photo shows up.

Example -This is generated by hand from html-

I would like to do this in xml. I can get the <a href where it works but I cannot get the thumbnail image to load in the table. I can do it with a text link but not an image.

Code
<xsl:variable name="smallimage" select="concat('../sheriff_n/images/MostWantedImages/', picturesmall)"/>
<xsl:variable name="largeimage" select="concat('../sheriff_n/images/MostWantedImages/', picture)"/>
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$largeimage"/></xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute>
<img border="2" src="../sheriff_n/images/MostWantedImages/SOhireswj_small.jpg"/>
<!-- <xsl:value-of select="$imagefinal"/> -->
The $imagefinal was a concat that made up the statement <img.....
Any help would be appreciated.

Tom
 
Code:
<a href="{concat('../sheriff_n/images/MostWantedImages/', picture)}" target="_blank">
  <img src="{concat('../sheriff_n/images/MostWantedImages/', picturesmall)}"  alt="pic"/>
</a>
 
It worked great!! I had tried something similiar except I didn't know about the curly brackets around the concat statement.

Thanks

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top