forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: ODT - Specifying images to be zipped?
Date Mon, 25 Aug 2008 10:32:59 GMT
Gavin wrote:
> <zip:archive>
> <zip:entry name="blah" ...></zip:entry>
> </zip:archive>
> 
> So I need a way to automatically create zip:entry blocks for images
> referenced within the file. The file may or may not be local, and as far as
> I can tell, we don't need to physically copy them anywhere, just reference
> their current locations as a zip entry.

Something like...

<xsl:template match="/">
   <!-- create other archive entries -->
   <xsl:call-template name="createImageEntries"/>
   <!-- more processing -->
</xsl:template>

<xsl:template name="createImageEntries">
   <xsl:for-each select="./image">
     <zip:entry>
       <xsl:attribute name="name">Pictures/<xsl:value-of 
select="@src"/></xsl:attribute> <!-- need to extract the relevant part 
of the URI here -->
       <xsl:attribute name="src">Pictures/<xsl:value-of 
select="@src"/></xsl:attribute> <!-- will probably need to make the path 
absolute, cocoon://... -->
     </zip:entry>
   </xsl:for-each>
</xsl:template>

Ross

Mime
View raw message