The following code does not work:
<xsl:variable name="width" select="form:im age-width"/>
<xsl:if test="$width>$m ax_image_width" >
<xsl:variable name="width" select="$max_im age_width"/>
</xsl:if>
<img class="admin" width="{$width} " src="{form:imag e-url}" />
The width attribute of img is always "", the $max_image_widt h variable is set to 200
and $width is initially set to the width of the image.
The purpose of this code is to bound the image width in an html page to a maximum length.
But the code does not work.
Please help!
Pseudo-code of the xsl code:
$max_image_widt h=200;
$width=[some value selected from xml file]
if($width>$max_ image_width) {
$width=$max_ima ge_width
}
print $width;
<xsl:variable name="width" select="form:im age-width"/>
<xsl:if test="$width>$m ax_image_width" >
<xsl:variable name="width" select="$max_im age_width"/>
</xsl:if>
<img class="admin" width="{$width} " src="{form:imag e-url}" />
The width attribute of img is always "", the $max_image_widt h variable is set to 200
and $width is initially set to the width of the image.
The purpose of this code is to bound the image width in an html page to a maximum length.
But the code does not work.
Please help!
Pseudo-code of the xsl code:
$max_image_widt h=200;
$width=[some value selected from xml file]
if($width>$max_ image_width) {
$width=$max_ima ge_width
}
print $width;
Comment