forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frédéric Glorieux <frederic.glori...@ajlsm.com>
Subject Re: [JIRA] Commented: (FOR-310) Support embedded open office images (and Impress files)
Date Sun, 24 Oct 2004 20:26:22 GMT

> I' not sure I understand the problem you are highlighting here. 

We have experience of real writers, with the 5% error.

OOo writer create new styleNames from original one when user add layout 
to the whole block (the 'P'). Our classical example is title document 
handling, very easy to see, and quite critic. This is reproductible

For example

  <office:body>
   <text:p text:style-name="Title">Document Title</text:p>
   <text:p text:style-name="P1">Document Title</text:p>
   <text:h text:style-name="Heading 1" text:level="1">Heading 1</text:h>
   <text:h text:style-name="P2" text:level="1">Heading 1</text:h>
  </office:body>


  <office:automatic-styles>
   <style:style style:name="P1" style:family="paragraph" 
style:parent-style-name="Title">
    <style:properties fo:font-weight="bold" 
style:font-weight-asian="bold" style:font-weight-complex="bold"/>
   </style:style>
   <style:style style:name="P2" style:family="paragraph" 
style:parent-style-name="Heading 1">
    <style:properties style:text-underline="single" 
style:text-underline-color="font-color"/>
   </style:style>
  </office:automatic-styles>

See @style:parent-style-name

This is quite not easy for users to unserstand how to get back to 
regular style  (OOo/Format/Default)


> The template you quot is a special matcher for people using the Forrest 
> template in the OpenOffice.org application to create a fixme in the 
> forrest XDoc format.

That's why I choose this one, users may not found their FIXME from their 
doc, less critic than a title document ...

Common workaroud is something like that

   <xsl:template match="text:p">
     <!-- get style -->
     <xsl:variable name="style">
       <xsl:apply-templates select="@text:style-name"/>
     </xsl:variable>
     <xsl:choose>
       <xsl:when test="$style='title' and normalize-space(.)!=''">
         <center>
           <h1 class="{$style}">
             <xsl:apply-templates/>
           </h1>
         </center>
       </xsl:when>
     <!-- ... -->
     </xsl:choose>
   </xsl:template>


   <!--

	get a semantic style name
	 - CSS compatible (no space, all min)
	 - from automatic styles

-->
   <xsl:template match="@text:style-name | @draw:style-name | 
@draw:text-style-name | @table:style-name">
     <xsl:variable name="current" select="."/>
     <xsl:choose>
       <xsl:when test="
//office:automatic-styles/style:style[@style:name = $current]
">
         <!-- can't understand why but sometimes there's a confusion
				between automatic styles with footer, same for header, fast patch 
here -->
         <xsl:value-of select="
translate(//office:automatic-styles/style:style[@style:name = 
$current][@style:parent-style-name!='Header'][@style:parent-style-name!='Footer']/@style:parent-style-name
, $majs, $mins)
"/>
       </xsl:when>
       <xsl:otherwise>
         <xsl:value-of select="translate($current , $majs, $mins)"/>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>

   <xsl:variable name="majs" 
select="'ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöùúûüýÿþ

.()/\?'"/>
   <xsl:variable name="mins" 
select="'abcdefghijklmnopqrstuvwxyzaaaaaaaeeeeiiiidnooooouuuuybbaaaaaaaceeeeiiiionooooouuuuyyb------'"/>



Fred.


-- 
Frédéric Glorieux (ingénieur documentaire, AJLSM)
<http://www.ajlsm.com>

Mime
View raw message