Jump to content

Recommended Posts

Posted

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/[email protected]" alt="this is my contact picture" class="contact"></picture>

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

Posted

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.

Posted

Oops forget to remove :) . Thanx this works. But one thing I can't figure out why. I get my alt text before my picture. And so the text is showed above my picture.

Posted

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

Posted

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 :) ?

Posted

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

Posted

This is my contact image

	.contact {  position: absolute;  top: 350px;  left: 700px;  z-index: 1;  }

Posted

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.

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...