forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ferdinand Soethe <samm...@soethe.net>
Subject Questions on extending the OOwriter-PlugIn to support HowTos
Date Thu, 03 Mar 2005 11:13:25 GMT
Hi Ross,

I'm trying to extend your OOWriter-Plugin to support HowTos and
so far it looks quite easy to do.

1. Changed OpenOffice-common2Forrest to insert some HowTo Header Info
   by adding the quoted sections:

  <!--+
      | start transforming 
      +-->
  <xsl:template match="/">
    <document>
      <header>
        <title>
          <xsl:choose>
            <xsl:when test="/office:document/office:meta/dc:title = '' or not(/office:document/office:meta/dc:title)">
              <xsl:value-of select="$filename"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="/office:document/office:meta/dc:title"/>
            </xsl:otherwise>
          </xsl:choose>
        </title>

>         <!-- Abstract is required field in HowTos, so always create it and fill with
description field  -->
>         <xsl:choose>
>                 <abstract>
>                         <xsl:when test="/office:document/office:meta/dc:description
= '' or not(/office:document/office:meta/dc:description)">
>                         </xsl:when>     
>                         <xsl:otherwise>
>                         <xsl:value-of select="/office:document/office:meta/dc:description"/>
>                 </xsl:otherwise>
>                 </abstract>
>         </xsl:choose> 
>         
>         <!-- last modified date -->
>         <last-modified-content-date date="format-dateTime({/office:document/office:meta/dc:date},
'[Y]-[M]-[D]')"/>


        <xsl:call-template name="style"/>
      </header>
      <xsl:apply-templates select="//office:body"/>
    </document>
  </xsl:template>
  
  <!--+
      | create the body 
      +-->
  <xsl:template match="office:body">
    <body>

       <!-- This is special for HowTo-Documents. Will make this
            conditonal as soon as it is working  -->
>      <header>
>         <title>
>           <xsl:choose>
>             <xsl:when test="/office:document/office:meta/dc:title = '' or not(/office:document/office:meta/dc:title)">
>               <xsl:value-of select="$filename"/>
>             </xsl:when>
>             <xsl:otherwise>
>               <xsl:value-of select="/office:document/office:meta/dc:title"/>
>             </xsl:otherwise>
>           </xsl:choose>
>         </title>
>
>         <!-- Abstract is required field in HowTos, so always create it and fill with
description field  -->
>         <xsl:choose>
>                 <section id="Overview">
>                         <title>Overview</title>
>                         <p>
>                         <xsl:when test="/office:document/office:meta/dc:description
= '' or not(/office:document/office:meta/dc:description)">
>                         </xsl:when>
>                         <xsl:otherwise>
>                         <xsl:value-of select="/office:document/office:meta/dc:description"/>
>                 </xsl:otherwise>
>                         </p>
>                 </section>
>         </xsl:choose>
>       </header>

    
      <xsl:apply-templates select="key('rootChildren', generate-id())"/>
      <xsl:apply-templates select="text:h[@text:level='1']"/>      
    </body>
  </xsl:template>


2. I used and tested the OO-Plugin before modifying the file in the
   plug-ins-dir then changed above file and re-ran Forrest

   Funny thing is, nothing changes. It still compiles w/o errors, but
   none of the elements show. Tried and called the document.xml and
   it's not there either.

 Do I need to somehow reload plugins after I've changed
 stylesheets or where is my mistake here?


--
Ferdinand Soethe



Mime
View raw message