Jump to content

show alt tekst


paetje

Recommended Posts

I want to fill in my alt text for the use of an caption beneath my pictureThe code in XSL-T for my picture:

	<xsl:template match="picture">  <xsl:value-of select="."/>  <xsl:variable name="src" select="@src"/>  <xsl:variable name="class" select="@class"/>  <img src="{$src}" class="{$class}"/>	</xsl:template>

code for my XML:

<picture src="../Pics/cont@ct.gif" alt="this is my contact picture" class="contact"></picture>

So this must give me my picture with "this is my contact picture" under it.

Link to comment
Share on other sites

I don't see what you need the <xsl:value-of select="." /> scince the picture element is empty, but if it must be like that, so be it. As for the alt text. If it must appear in both the image and below the image:

<xsl:template match="picture"> <xsl:value-of select="."/> <xsl:variable name="src" select="@src"/> <xsl:variable name="class" select="@class"/> <xsl:variable name="alt" select="@alt"/> <img src="{$src}" class="{$class}" alt="{$alt}"/> <xsl:value-of select="$alt" /></xsl:template>

If it must appear only below the image, you can always remove the variable and place @alt at the last <xsl:value-of /> instead.

Link to comment
Share on other sites

It works fine with me (no CSS attached). Perhaps a <br /> after the <img />?

Link to comment
Share on other sites

It's quite strange, when I connect an class to the picture (and the alt-tekst) it puts my alt tekt on top :) . But when I don't have a class it shows my picture first :) , this is the way it supposed to be.But how can I make it the way that its always the right way :) ?

Link to comment
Share on other sites

What are the class's properties? We are talking CSS problem here after all.

Link to comment
Share on other sites

Well no wonder then. Absolute positioning as far as I know places the element on the specified pixels from the screen's top left edge no matter where in the code it is. Make it relative or adjust the pixels properly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...