Print

Print


Let me suggest another solution.  My understanding of the HTML <alt> tag is slightly different and it certainly does appear when the mouse rolls over the image even when one is displayed.   If this is the effect you want, this template works.
 
<xsl:template match="dao">
      <img src="{@href}" alt="@altrender" />
 </xsl:template>
 
Michael

________________________________

From: Encoded Archival Description List on behalf of MicheleR
Sent: Tue 4/12/2005 5:46 PM
To: [log in to unmask]
Subject: Re: Linking jpegs using <dao>



> > I have a further question: how can I also show the legend of the photo,
> > while just hovering over it?

> I believe that what you want is a script with an ONMOUSEOVER event.
> Maybe someone else can clarify the script format.  I have limited
experience
> with these but I think that it would look something like this.

Actually I don't think you need go as far as mouseover.  I think capturing
the legend or title of the dao and outputting that as the TITLE attribute in
the IMG element should do it (not the ALT attribute -- the ALT attribute is
what shows up if the picture can't/doesn't load).  Assuming that the legend
is in the TITLE attribute of your <dao> element, I think it would work like
this:

Input:
<dao show="embed" href="picture.jpg" title="my dog spot"/>)

XSL:
<xsl:template match="dao[@show='embed']">
        <img src="{@href}" title="{@title}">
                <xsl:apply-templates/>
        </img>
</xsl:template>

Output:
<img src="picture.jpg" title="my dog spot">

Note that the "<xsl:template match..." line checks to make sure that the
<dao> element has the SHOW attribute set to EMBED.  You'd also want to check
that it has the TITLE attribute present, or provide error handling for
graphics that don't.  I'm not sure how to do either of those things!  Maybe
someone else can clarify that piece.

Michele