forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r154829 - in forrest/trunk/plugins/org.apache.forrest.plugin.excel: resources/stylesheets/table2document.xsl src/documentation/content/xdocs/samples/figure-table.xml status.xml
Date Tue, 22 Feb 2005 10:36:51 GMT
Author: rgardler
Date: Tue Feb 22 02:36:49 2005
New Revision: 154829

URL: http://svn.apache.org/viewcvs?view=rev&rev=154829
Log:
new support for descriptive text, images in cells, respects comment in excel->Properties,
supports internal linking and some minor bug fixes (thanks to   Johannes Schaefer)

Modified:
    forrest/trunk/plugins/org.apache.forrest.plugin.excel/resources/stylesheets/table2document.xsl
    forrest/trunk/plugins/org.apache.forrest.plugin.excel/src/documentation/content/xdocs/samples/figure-table.xml
    forrest/trunk/plugins/org.apache.forrest.plugin.excel/status.xml

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.excel/resources/stylesheets/table2document.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.excel/resources/stylesheets/table2document.xsl?view=diff&r1=154828&r2=154829
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.excel/resources/stylesheets/table2document.xsl
(original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.excel/resources/stylesheets/table2document.xsl
Tue Feb 22 02:36:49 2005
@@ -11,6 +11,7 @@
      <title><xsl:value-of select="*/o:Title"/></title>
     </header>
     <body>
+      <p><xsl:value-of select="*/o:Description"/></p>
       <xsl:apply-templates/>
     </body>
    </document>
@@ -18,18 +19,22 @@
 
   <xsl:template match="ss:Worksheet"> 
     <section>
+      <xsl:attribute name="id"><xsl:value-of select="@ss:Name"/></xsl:attribute>
       <title><xsl:value-of select="@ss:Name"/></title>
       <xsl:apply-templates/>
     </section>
   </xsl:template>
 
   <xsl:template match="ss:Table">
+    <xsl:apply-templates select="ss:Row[ss:Cell[position()='1']='text']"   mode="text"/>
     <xsl:apply-templates select="ss:Row[ss:Cell[position()='1']='figure']" mode="figure"/>
     <table>
       <caption><xsl:value-of select="parent::ss:Worksheet/@ss:Name"/></caption>
       <xsl:apply-templates select="ss:Row[position()=1]" mode="header"/>
       <xsl:apply-templates 
-           select="ss:Row[ss:Cell!='' and position()!=1 and ss:Cell[position()='1']!='figure']"/>
+           select="ss:Row[ss:Cell!='' and position()!=1 
+              and ss:Cell[position()='1']!='figure' 
+              and ss:Cell[position()='1']!='text']"/>
     </table>
   </xsl:template>
 
@@ -48,36 +53,44 @@
   </xsl:template>
   <xsl:template match="ss:Cell">
     <td>
-      <xsl:if test="contains(ss:Data, '#')">
+      <xsl:choose>
+      <xsl:when test="contains(ss:Data, '#')">
         <xsl:attribute name="style">background-color:<xsl:value-of select="ss:Data"/>;
         <xsl:if test="contains(ss:Data, '#000000')">
           color:#ffffff
         </xsl:if>
         </xsl:attribute>
-      </xsl:if>
-      <xsl:value-of disable-output-escaping="no" select="ss:Data" />
+        <xsl:value-of select="ss:Data" />
+      </xsl:when>
+      <xsl:when test="contains(ss:Data, '.png') or contains(ss:Data, '.gif') or contains(ss:Data,
'.jpg')">
+        <img>
+          <xsl:attribute name="src">images/<xsl:value-of select="ss:Data"/></xsl:attribute>
+          <xsl:attribute name="alt">images/<xsl:value-of select="ss:Data"/></xsl:attribute>
+        </img>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of disable-output-escaping="no" select="ss:Data" />
+      </xsl:otherwise>
+      </xsl:choose>
     </td>
   </xsl:template>
 
   <xsl:template match="ss:Row" mode="figure">
-    <table><tr><td>
-    <xsl:element name="img">  <!-- changed to figure: renders @ALT as caption -->
+    <xsl:element name="img">
       <xsl:attribute name="src"><xsl:text>images/</xsl:text>
          <xsl:value-of select="ss:Cell[position()='2']"/>
       </xsl:attribute>
       <xsl:attribute name="alt">
-         <xsl:value-of select="ss:Cell[position()='4']/ss:Data"/>
+         <xsl:value-of select="ss:Cell[position()='4' or @ss:Index='4']/ss:Data"/>
       </xsl:attribute>
     </xsl:element>
-    </td></tr>
-<!-- this is not needed since @ALT is rendered as figure caption
-    <tr><td>
-    <em>Figure: <xsl:value-of select="ss:Cell[position()='4' or @ss:Index='4']"/></em>
-    </td></tr>
--->
-    </table>
   </xsl:template>
 
+  <xsl:template match="ss:Row" mode="text">
+    <p>
+      <xsl:value-of select="ss:Cell[position()='2']"/>
+    </p>
+  </xsl:template>
 
   <xsl:template match="node()"/>   <!-- remove anything else -->
 

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.excel/src/documentation/content/xdocs/samples/figure-table.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.excel/src/documentation/content/xdocs/samples/figure-table.xml?view=diff&r1=154828&r2=154829
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.excel/src/documentation/content/xdocs/samples/figure-table.xml
(original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.excel/src/documentation/content/xdocs/samples/figure-table.xml
Tue Feb 22 02:36:49 2005
@@ -7,6 +7,7 @@
  <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
   <Title>Table with figures</Title>
   <Author>Johannes Schaefer</Author>
+  <Description>This is already a more complex example. It uses tables, figures and
text for tables as well as an initial descriptive paragraph (Comment in Excel File Properties).</Description>
   <LastAuthor>Johannes Schaefer</LastAuthor>
   <Created>2004-11-16T11:18:22Z</Created>
   <LastSaved>2004-12-14T08:22:23Z</LastSaved>
@@ -41,25 +42,25 @@
    <Font x:Family="Swiss" ss:Italic="1"/>
   </Style>
   <Style ss:ID="s23">
-   <NumberFormat ss:Format="Fixed"/>
-  </Style>
-  <Style ss:ID="s24">
-   <Font ss:Size="12"/>
+   <Alignment ss:Vertical="Top"/>
+   <Font x:Family="Swiss" ss:Bold="1"/>
   </Style>
   <Style ss:ID="s25">
-   <Font ss:Size="12"/>
+   <Alignment ss:Horizontal="Left" ss:Vertical="Top" ss:WrapText="1"/>
+  </Style>
+  <Style ss:ID="s26">
    <NumberFormat ss:Format="Fixed"/>
   </Style>
-  <Style ss:ID="s30">
+  <Style ss:ID="s28">
    <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
    <NumberFormat ss:Format="Fixed"/>
   </Style>
-  <Style ss:ID="s35">
-   <Alignment ss:Vertical="Top"/>
-   <Font x:Family="Swiss" ss:Bold="1"/>
+  <Style ss:ID="s29">
+   <Font ss:Size="12"/>
   </Style>
-  <Style ss:ID="s36">
-   <Alignment ss:Horizontal="Left" ss:Vertical="Top" ss:WrapText="1"/>
+  <Style ss:ID="s30">
+   <Font ss:Size="12"/>
+   <NumberFormat ss:Format="Fixed"/>
   </Style>
  </Styles>
  <Worksheet ss:Name="Example table">
@@ -99,8 +100,8 @@
     <Cell ss:Index="6" ss:StyleID="s22"/>
    </Row>
    <Row ss:AutoFitHeight="0" ss:Height="75">
-    <Cell ss:StyleID="s35"><Data ss:Type="String">text</Data></Cell>
-    <Cell ss:MergeAcross="4" ss:StyleID="s36"><Data ss:Type="String">You may
add more than one paragraph and may use Excel features here like joining cells and line break
for cells. Expecially useful if you write a lot of text. Just make sure your text starts in
the second column.</Data></Cell>
+    <Cell ss:StyleID="s23"><Data ss:Type="String">text</Data></Cell>
+    <Cell ss:MergeAcross="4" ss:StyleID="s25"><Data ss:Type="String">You may
add more than one paragraph and may use Excel features here like joining cells and line break
for cells. Expecially useful if you write a lot of text.    Just make sure your text starts
in the second column.</Data></Cell>
    </Row>
    <Row>
     <Cell ss:Index="2" ss:StyleID="s21"/>
@@ -143,7 +144,7 @@
    <Panes>
     <Pane>
      <Number>3</Number>
-     <ActiveRow>10</ActiveRow>
+     <ActiveRow>7</ActiveRow>
      <ActiveCol>1</ActiveCol>
     </Pane>
    </Panes>
@@ -165,64 +166,64 @@
    </Row>
    <Row>
     <Cell><Data ss:Type="String">something</Data></Cell>
-    <Cell ss:StyleID="s23"><Data ss:Type="Number">1</Data></Cell>
+    <Cell ss:StyleID="s26"><Data ss:Type="Number">1</Data></Cell>
     <Cell><Data ss:Type="String">nope</Data></Cell>
     <Cell><Data ss:Type="String">store</Data></Cell>
    </Row>
    <Row>
     <Cell><Data ss:Type="String">anything</Data></Cell>
-    <Cell ss:StyleID="s23"><Data ss:Type="Number">2</Data></Cell>
+    <Cell ss:StyleID="s26"><Data ss:Type="Number">2</Data></Cell>
     <Cell><Data ss:Type="String">no comment</Data></Cell>
     <Cell><Data ss:Type="String">/home/user/store</Data></Cell>
    </Row>
    <Row>
     <Cell><Data ss:Type="String">what else</Data></Cell>
-    <Cell ss:StyleID="s23"><Data ss:Type="Number">3</Data></Cell>
+    <Cell ss:StyleID="s26"><Data ss:Type="Number">3</Data></Cell>
     <Cell><Data ss:Type="String">nothing</Data></Cell>
     <Cell><Data ss:Type="String">/root</Data></Cell>
    </Row>
    <Row>
     <Cell><Data ss:Type="String">what's up</Data></Cell>
-    <Cell ss:StyleID="s23"><Data ss:Type="Number">4</Data></Cell>
+    <Cell ss:StyleID="s26"><Data ss:Type="Number">4</Data></Cell>
     <Cell><Data ss:Type="String">nil</Data></Cell>
     <Cell><Data ss:Type="String">/tmp</Data></Cell>
    </Row>
    <Row>
     <Cell><Data ss:Type="String">  </Data></Cell>
-    <Cell ss:StyleID="s23"><Data ss:Type="Number">4.9</Data></Cell>
+    <Cell ss:StyleID="s26"><Data ss:Type="Number">4.9</Data></Cell>
     <Cell><Data ss:Type="String">  </Data></Cell>
     <Cell><Data ss:Type="String">/dev/null</Data></Cell>
    </Row>
    <Row>
-    <Cell ss:Index="2" ss:StyleID="s23"/>
+    <Cell ss:Index="2" ss:StyleID="s26"/>
    </Row>
    <Row>
     <Cell ss:StyleID="s21"><Data ss:Type="String">figure</Data></Cell>
-    <Cell ss:StyleID="s23"><Data ss:Type="String">shop.jpg</Data></Cell>
+    <Cell ss:StyleID="s26"><Data ss:Type="String">shop.jpg</Data></Cell>
     <Cell ss:Index="4"><Data ss:Type="String">Caption must be in column D!</Data></Cell>
    </Row>
    <Row>
     <Cell ss:StyleID="s21"><Data ss:Type="String">text</Data></Cell>
-    <Cell ss:StyleID="s23"><Data ss:Type="String">This is a mere Example and
does not resemble the structure of any real world shop.</Data></Cell>
+    <Cell ss:StyleID="s26"><Data ss:Type="String">This is a mere Example and
does not resemble the structure of any real world shop.</Data></Cell>
    </Row>
    <Row>
     <Cell ss:StyleID="s21"><Data ss:Type="String">text</Data></Cell>
-    <Cell ss:MergeAcross="4" ss:StyleID="s30"><Data ss:Type="String">The screenshot
was taken from the web.</Data></Cell>
+    <Cell ss:MergeAcross="4" ss:StyleID="s28"><Data ss:Type="String">The screenshot
was taken from the web.</Data></Cell>
    </Row>
    <Row ss:AutoFitHeight="0" ss:Height="15">
-    <Cell ss:StyleID="s24"/>
-    <Cell ss:StyleID="s25"/>
-    <Cell ss:StyleID="s24"/>
+    <Cell ss:StyleID="s29"/>
+    <Cell ss:StyleID="s30"/>
+    <Cell ss:StyleID="s29"/>
    </Row>
    <Row ss:AutoFitHeight="0" ss:Height="15">
-    <Cell ss:StyleID="s24"/>
-    <Cell ss:StyleID="s25"/>
-    <Cell ss:StyleID="s24"/>
+    <Cell ss:StyleID="s29"/>
+    <Cell ss:StyleID="s30"/>
+    <Cell ss:StyleID="s29"/>
    </Row>
    <Row ss:AutoFitHeight="0" ss:Height="15">
-    <Cell ss:StyleID="s24"/>
-    <Cell ss:StyleID="s25"/>
-    <Cell ss:StyleID="s24"/>
+    <Cell ss:StyleID="s29"/>
+    <Cell ss:StyleID="s30"/>
+    <Cell ss:StyleID="s29"/>
    </Row>
   </Table>
   <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.excel/status.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.excel/status.xml?view=diff&r1=154828&r2=154829
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.excel/status.xml (original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.excel/status.xml Tue Feb 22 02:36:49 2005
@@ -19,18 +19,36 @@
 
   <developers>
     <person name="Ross Gardler" email="rgardler@apache.org" id="RDG" />
+    <person name="Johannes Schaefer"      email="jschaefer@uidesign.de"      id="js" />
     <person name="Volunteer needed" email="dev@forrest.apache.org" id="open"/>
   </developers>
 
   <changes>
-    <release version="0.1" date="unreleased">
-      <action type="add" context="xsl" dev="RDG" due-to="Johannes Schaefer" fixes-bug="FOR-432">
-        New feature: 'text' in first column to create descriptive text.
+    <release version="0.2" date="2005-02-22">
+      <action type="add" context="Document Properties" dev="js">
+        Put Description from Excel document properties as a paragraph
+        at the beginning of the document
+      </action>
+      <action type="fix" context="Figure" dev="js">
+        Removed table around figures
+      </action>
+      <action type="add" context="Stylesheet" dev="js">
+        New feature: put id=sheet name in to allow #id links
+      </action>
+      <action type="add" context="Stylesheet" dev="js">
+        New feature: content containing .png, .gif or .jpg is
+        displayed as image; use path below image directory
+      </action>
+      <action type="add" context="xsl" dev="RDG" due-to="Johannes Schaefer">
+        New feature: 'text' in first column to create descriptive
+        text.
       </action>
-      <action type="fix" context="caption" dev="RDG" due-to="Johannes Schaefer" fixes-bug="FOR-432">
+      <action type="fix" context="caption" dev="RDG" due-to="Johannes Schaefer">
         Minor issue: captions are now included even if Excel skips
         cell at position three and writes weird "ss:Index=4".
       </action>
+    </release>
+    <release version="0.1" date="unreleased">
       <action dev="RDG" type="fix" due-to="Johannes Schaefer" fixes-bug="FOR-432">
         Fixed bug: input.xmap pointed to the project's resources dir
         not the plugin's. So, plugin documentation worked fine, but
@@ -44,25 +62,25 @@
 
   <todo>
     <actions priority="high">
-      <action context="xsl" dev="open">
+      <action context="Stylesheet" dev="open">
         Resolve empty cell issue: insert empty cell in output
         if any cell in column is non-empty. Workaround: put
 	spaces in the Excel cells.
       </action>
-      <action context="code" dev="open">
+      <action context="xmap" dev="open">
         Match the Excel document type definition rather than <code>**-table.xml</code>.
       </action>
-      <action context="xsl" dev="open">
+      <action context="Stylesheet" dev="open">
         New feature: include Excel tables in other xml documents.
       </action>
-      <action context="xsl" dev="open">
+      <action context="Stylesheet" dev="open">
         New feature: allow xdoc tags in Cells. Problem: Excel saves
 	tags escaped, i.e. <code>&amp;lt;tag&amp;gt;</code>.
       </action>
-      <action context="docs" dev="open">
+      <action context="Documentation" dev="open">
         Put in the English wording from Excel (sorry, I only have German available).
       </action>
-      <action context="docs" dev="open">
+      <action context="Documentation" dev="open">
         Add sections: feature description and implementation details.
       </action>
     </actions>



Mime
View raw message