Creating link to html Image

Hi Experts,

In xslt below, It is creating html img tag from attached xml file

<xsl:template name="output-album">
        <xsl:param name="sno"/>
                <xsl:when test="../Album[@sno = $sno]">
                    <xsl:for-each select="(../Album[@sno = $sno]/Media/*[@sno = 1]/thumbnail | ../Album[@sno = $sno]/Media/*[@sno = 1]/thumbMedia)[1]">
                            <img src="{.}"/>
I wanted to create a link to this image from the album @id attribute

<Album name="Album 1" sno="1" id="tcm:501-638216">
          <Image sno="1">
            <description>The Burj Image-Asit</description>
          <Image sno="2">
          <description>The Burj Image-Asit</description>

I tried various ways, but not sure what I am doing wrong, I am not able to pick id. I wrote

<xsl:attribute name="href">
    Album.aspx?id=<xsl:value-of select="Album/@id" />
<img src="{.}"/>

My link to image tag is always coming blank. Please help me picking the

id attribute from just above Album node.

In above example id from below node

<Album name="Album 1" sno="1" id="tcm:501-638216">.

It is picking image src from node

Please find my complete xml, xslt attached

Many Thanks
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Geert BormansInformation ArchitectCommented:
do you want your image to be clickable?

you are not in teh scope of teh parent of Album, so your href can not work.
You need to go look for the ancestor::Album since you are at the thumbnail level already

<xsl:attribute name="href">
    Album.aspx?id=<xsl:value-of select="ancestor::Album/@id" />


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tia_kamakshiAuthor Commented:
Many Thanks
Geert BormansInformation ArchitectCommented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.