[xsl] trying again: automaticly image width and height

Subject: [xsl] trying again: automaticly image width and height
From: Janning Vygen <vygen@xxxxxxxxxxxx>
Date: Fri, 11 May 2001 22:17:09 +0200
first question didnt get an answer. why? was ist so stupid??

heres my question again:
i tried some extension from lunatech to insert width and height into the img 
tags of a html nod set. i cant find the lunatech extensions in the internet 
again, so i cant ask them why the i get an input stream error after about 400 
images.

Does anybody has another  tool for inserting img width and height into an 
xhtml stream? Would be a great help for me.

thanks in advance 
janning

my xsl looks like this:

<xsl:template match="@*|node()" mode="html.defaults">
  <xsl:copy>
    <xsl:apply-templates select="@*|node()" mode="html.defaults"/>
  </xsl:copy>
</xsl:template>

<xsl:template match="img" mode="html.defaults">
  <xsl:copy use-attribute-sets="img.defaults">
    <xsl:for-each select="@*">
      <xsl:copy/>
    </xsl:for-each>
    <xsl:if test="not(@width) or not(@height)">
      <xsl:variable name="source" select="concat($img.path, @src)"/>
      <xsl:if test="function-available('ImageSize:get-image-width')">
        <xsl:attribute name="width">
          <xsl:value-of select="ImageSize:get-image-width($source)"/>
        </xsl:attribute>
        <xsl:attribute name="height">
          <xsl:value-of select="ImageSize:get-image-height($source)"/>
        </xsl:attribute>
      </xsl:if>
    </xsl:if>
    <xsl:apply-templates mode="html.defaults"/>
  </xsl:copy>
</xsl:template>

-- 
Planwerk 6 /websolutions
Herzogstraße 86
40215 Düsseldorf

fon 0211-6015919
fax 0211-6015917
http://www.planwerk6.de

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread