xsl-list
[Top] [All Lists]

[xsl] Fwd: xslt:image resizing

2009-03-11 21:04:43
Hello

im looking for something like image resizeing, i tried with this peace of code, but it wont work?


<xsl:template match="*[local-name()='img']">
  <br></br>
  <img>
      <xsl:attribute name="src">
          <xsl:copy-of select="resolve-uri(@src,$url)"/>
</xsl:attribute> <xsl:choose> <xsl:when test="@width > $width and @heigth &gt;= $height">
              <xsl:attribute name="width">
                  <xsl:value-of select="($width div @width) * @width" />px
              </xsl:attribute>
              <xsl:attribute name="height">
<xsl:value-of select="($width div @width) * @heigth" />px
              </xsl:attribute>
</xsl:when> <xsl:when test="@height > $height and @width &lt; $height">
              <xsl:attribute name="width">
                  <xsl:value-of select="($width div @height) * @width" />
              </xsl:attribute>
              <xsl:attribute name="height">
<xsl:value-of select="($height div @height) * @height" />
              </xsl:attribute>
          </xsl:when>
      </xsl:choose>
  </img>
</xsl:template>

greeting stefan

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>