[xsl] using lunatech extension, getting error messages

Subject: [xsl] using lunatech extension, getting error messages
From: Janning Vygen <vygen@xxxxxxxxxxxx>
Date: Wed, 9 May 2001 16:30:00 +0200
Hi,

i am using the lunatech extension for Saxon because i want to insert image 
width and height automatically

but after processing many, many images correct, finally i get an error 
message like

cannnot create input stream for {filename}

my xsl looks like this (at the bottom of the mail) and it works fine, before 
writing a chunk i apply my html.defaults templates to the output tree. It 
seems to me that lunatech.saxon.ext. ImageSize has to many opened files, but 
as i am not a very good java programmer i dont know if i am right. 

Any Suggestions? 

maybe a little bit off-topic? sorry for this, but the error might be in the 
stylesheet to for not freeing the resources??

thanks in advance 
janning


<xsl:attribute-set name="img.defaults">
  <xsl:attribute name="border">0</xsl:attribute>
</xsl:attribute-set>
 
<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-info')">
        <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:if test="not(@alt)">
      <xsl:attribute name="alt">
        <xsl:value-of select="substring-before(substring-after(@src, '/'), 
'.')"/>
      </xsl:attribute>
    </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