cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ross Burton" <ross.bur...@mail.com>
Subject Re: [C2] Stylebook features
Date Tue, 23 May 2000 17:56:19 GMT
> > Any ideas of what would be the cleanest way of implementing this idea in
> > Cocoon 2?
>
> I would have thought SVG is the cleanest and simplest way of
> achieving that - gives you total flexibility to build the
> images as you see fit, and we can serialize them to PNG
> (using your code, Ross ;) until the browsers support SVG
> directly.

My point was that in Stylebook it is easy to automatically create a set of
files by simply calling a XSL template.  An example ripped straight from the
Stylebook docs:

    ...
    <xsl:call-template name="header">
      <xsl:with-param name="id"     select="@id"/>
      <xsl:with-param name="source" select="@source"/>
      <xsl:with-param name="label"  select="@label"/>
    </xsl:call-template>
    ...

  <xsl:template name="header">
    <xsl:param name="id"/>
    <xsl:param name="source"/>
    <xsl:param name="label"/>
    <xsl:param name="type"/>

    <create source="{$source}" target="graphics/{$id}-header.jpg"
producer="parser" printer="image">
      <processor name="xslt">
        <parameter name="stylesheet"
value="sbk:/style/stylesheets/document2image.xsl"/>
      </processor>
    </create>
  </xsl:template>

Stylebook (as far as I know) understands the <create> tag and does the work.
The point is that by simply having the name and ID of a label, an image of
it can be generated easily.  I don't think I'm missing anything here (though
I propably am) but can anyone see a way of reproducing this "automatic"
behaviour?

Ross Burton


Mime
View raw message