freddo99 0 Posted October 5, 2012 Report Share Posted October 5, 2012 I have the following code in the xsl file <IMG name="logo" border="1" vspace="20" hspace="50"> <xsl:attribute name="src"><xsl:value-of select="@fname"/> </xsl:attribute> <xsl:attribute name="width"><xsl:value-of select="[email="imagesize/@width"]imagesize/@height"/[/email]> </xsl:attribute> <xsl:attribute name="alt"><xsl:value-of select="title"/> </xsl:attribute></IMG> and want to be able to test for the value of width and change both the value of width and height if the test is meet. I have tried the following which does not work. <IMG name="logo" border="1" vspace="20" hspace="50"> <xsl:attribute name="src"><xsl:value-of select="@fname"/> </xsl:attribute><xsl:if test="420 > [email="imagesize/@width"]imagesize/@width[/email]"> <pwidth>420</pwidth> <pheight>560/pheight></xsl:if> <xsl:attribute name="width"><xsl:value-of select="pwidth"/> </xsl:attribute> <xsl:attribute name="height"><xsl:value-of select="pheight"/> </xsl:attribute> <xsl:attribute name="alt"><xsl:value-of select="title"/> </xsl:attribute></IMG> I was not sure how to replace the existing values of width and height so tried to create new variables but really just change the original values of width and height if the IF test condition is meet. Can anyone help please? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.