T
Tjerk Wolterink
The following code does not work:
<xsl:variable name="width" select="form:image-width"/>
<xsl:if test="$width>$max_image_width">
<xsl:variable name="width" select="$max_image_width"/>
</xsl:if>
<img class="admin" width="{$width}" src="{form:image-url}" />
The width attribute of img is always "", the $max_image_width 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_width=200;
$width=[some value selected from xml file]
if($width>$max_image_width) {
$width=$max_image_width
}
print $width;
<xsl:variable name="width" select="form:image-width"/>
<xsl:if test="$width>$max_image_width">
<xsl:variable name="width" select="$max_image_width"/>
</xsl:if>
<img class="admin" width="{$width}" src="{form:image-url}" />
The width attribute of img is always "", the $max_image_width 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_width=200;
$width=[some value selected from xml file]
if($width>$max_image_width) {
$width=$max_image_width
}
print $width;