forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <>
Subject Re: [jira] Commented: (FOR-872) Updated odt_to_xhtml.xsl to pass <title> & <h1> elements.
Date Fri, 05 May 2006 10:01:34 GMT
Clay Leeds (JIRA) wrote:
>     [ ] 
> Clay Leeds commented on FOR-872:
> --------------------------------
> BTW, you could add the following to resources/stylesheets/odt-to-forrest-xhtml.xsl to
get T1 to be styled as STRONG/BOLD:
>   <xsl:template match="text:p/text:span[@text:style-name='T1']">
>     <strong>
>       <xsl:apply-templates/>
>     </strong>
>   </xsl:template>

I've not looked at your full stylesheets yet, but have a comment on the 

The problem with this kind of approach is that it assumes that "T1" is 
always "strong". My experience with OOo tells me this is a bad 
assumption (may have changed in OOo2.

It is better to dynamically generate the CSS from the styles definitions 
in the ODT file. They are already in CSS format so it is not a big job. 
I did this in the OOo plugin as an experiment [1]. What it does is use 
the template below to generate the style definitions in the head of the 
XDoc, but see [2] for some discussion about this.

<xsl:template name="style">
     <!-- HACK: This makes intermediate documents invalid per the
     Forrest Document DTD. To find out why this is done this way
     nonetheless, read the comments attached to issue FOR-433. -->
       <xsl:apply-templates select="//office:styles/style:style"/>
       <xsl:apply-templates select="//office:automatic-styles/style:style"/>

Now, as you can see this not valid in the XDoc schema. It works, but it 
is a hack (at least it did in my experiments, but that was a long time 
ago, things may have changed to break it now). Instead of embedding the 
content in the XDoc head we should have a separate request that 
generates the extra-css for the skinnning stage. We had a discussion 
about how to do this recently [3]

My ultimate goal with these experiments (which stalled a long time ago) 
was to allow a subset of the OOo style information to pass through to 
the rendering of a Forrest content object. The idea was to have this 
subset defined in a config file, thus individual users would be able to 
say what style information from OOo was vald in their final output. For 
example, they could choose to not allow colour definition trough in 
order to ensure a consistent colour scheme, but to allow underlines through.



View raw message