Jump to content

freddo99

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by freddo99

  1. I have an xsl file with the following two lines "<xsl:attribute name="width"><xsl:value-of select="imagesize/@width"/></xsl:attribute>" "<xsl:attribute name="height"><xsl:value-of select="imagesize/@height"/></xsl:attribute>" I want to test for the value of imagesize/@width and set the values of width and height if the test condition is meet. I have tried the following without success <xsl:choose> <xsl:when test="350 > imagesize/@width"> <xsl:attribute name="width"><xsl:value-of select="420"/></xsl:attribute> <xsl:attribute name="height"><xsl:value-of select="560"/></xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="width"><xsl:value-of select="imagesize/@width"/></xsl:attribute> <xsl:attribute name="height"><xsl:value-of select="imagesize/@height"/></xsl:attribute> </xsl:otherwise></xsl:choose> I have also tried <xsl:when test="350 > <xsl:value-of select=<xsl:value-of-select='imagesize/@width'/>"> Can someone please help?
  2. 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?
×
×
  • Create New...