forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r628587 - in /forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets: document-to-fo.xsl helper-commonElements.xsl helper-layout.xsl helper-pdfoutline.xsl pdfoutline.xsl
Date Mon, 18 Feb 2008 00:39:50 GMT
Author: thorsten
Date: Sun Feb 17 16:39:49 2008
New Revision: 628587

URL: http://svn.apache.org/viewvc?rev=628587&view=rev
Log:
Moving toc generation back to the main xsl. extracted layout variables to helper on its own.
renamed file to follow the pattern

Added:
    forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-layout.xsl
  (with props)
    forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-pdfoutline.xsl
      - copied unchanged from r628544, forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/pdfoutline.xsl
Removed:
    forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/pdfoutline.xsl
Modified:
    forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl
    forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-commonElements.xsl

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl?rev=628587&r1=628586&r2=628587&view=diff
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl
(original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl
Sun Feb 17 16:39:49 2008
@@ -104,152 +104,17 @@
   <xsl:param
         name="xmlbasedir" />
   <xsl:include
-        href="pdfoutline.xsl" />
+        href="helper-pdfoutline.xsl" />
   <xsl:include
         href="footerinfo.xsl" />
   <xsl:include
-        href="helper-pageBreaks.xsl" />
+        href="lm://pdf.transform.helper.pageBreaks" />
   <xsl:include
         href="helper-pageNumber.xsl" />
   <xsl:include
         href="helper-commonElements.xsl" />
-<!-- Determine page height for various page sizes (US Letter portrait
-  is the default) -->
-<!-- FIXME: JJP:would this be better of a file? -->
-  <xsl:variable
-        name="pageheight">
-    <xsl:choose>
-      <xsl:when
-                test="$pageorientation = 'landscape'">
-        <xsl:choose>
-          <xsl:when
-                        test="$pagesize = 'a0'">841mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a1'">594mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a2'">420mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a3'">297mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a4'">210mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a5'">148mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'executive'">7.25in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'folio'">8.5in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'ledger'">11in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'legal'">8.5in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'letter'">8.5in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'quarto'">8.5in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'tabloid'">11in</xsl:when>
-          <xsl:otherwise>8.5in</xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:choose>
-          <xsl:when
-                        test="$pagesize = 'a0'">1189mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a1'">841mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a2'">594mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a3'">420mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a4'">297mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a5'">210mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'executive'">10.5in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'folio'">13in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'ledger'">17in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'legal'">14in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'quarto'">10.83in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'tabloid'">17in</xsl:when>
-          <xsl:otherwise>11in</xsl:otherwise>
-        </xsl:choose>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-<!-- Determine page width for various page sizes (US Letter portrait
-  is the default) -->
-  <xsl:variable
-        name="pagewidth">
-    <xsl:choose>
-      <xsl:when
-                test="$pageorientation = 'landscape'">
-        <xsl:choose>
-          <xsl:when
-                        test="$pagesize = 'a0'">1189mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a1'">841mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a2'">594mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a3'">420mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a4'">297mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a5'">210mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'executive'">10.5in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'folio'">13in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'ledger'">17in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'legal'">14in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'quarto'">10.83in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'tabloid'">17in</xsl:when>
-          <xsl:otherwise>11in</xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:choose>
-          <xsl:when
-                        test="$pagesize = 'a0'">841mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a1'">594mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a2'">420mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a3'">297mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a4'">210mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'a5'">148mm</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'executive'">7.25in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'folio'">8.5in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'ledger'">11in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'legal'">8.5in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'letter'">8.5in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'quarto'">8.5in</xsl:when>
-          <xsl:when
-                        test="$pagesize = 'tabloid'">11in</xsl:when>
-          <xsl:otherwise>8.5in</xsl:otherwise>
-        </xsl:choose>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
+  <xsl:include
+        href="helper-layout.xsl" />
   <xsl:template
         match="/">
     <fo:root
@@ -527,5 +392,57 @@
       </xsl:for-each>
     </fo:block>
   </xsl:template>
-  
+  <xsl:template match="body[count(//section) != 0]">
+    <xsl:if test="$disable-toc != 'true' and $toc-max-depth > 0">
+      <fo:block font-family="sans-serif" font-size="12pt" font-weight="bold"
+        space-after="5pt" space-before="5pt" text-align="justify" width="7.5in">
+        <xsl:call-template name="insertPageBreaks"/>
+        <!-- insert i18n stuff here -->
+        <xsl:text>Table of contents</xsl:text>
+      </fo:block>
+      <fo:block font-family="serif" font-size="12pt" space-after="5pt"
+        space-before="0pt" text-align="justify" width="7.5in">
+        <xsl:if test="$page-break-top-sections">
+          <xsl:attribute name="break-after">page</xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates select="section" mode="toc"/>
+      </fo:block>
+    </xsl:if>
+    <xsl:apply-templates/>
+  </xsl:template>
+  <xsl:template match="section" mode="toc">
+    <!-- FIXME: see bug FOR-640 -->
+    <xsl:param name="depth" select="'1'"/>
+    <fo:block space-before="5pt" text-align-last="justify" start-indent=".5em"
+      text-indent=".5em">
+      <fo:inline>
+        <xsl:variable name="id">
+          <xsl:choose>
+            <xsl:when test="normalize-space(@id)!=''">
+              <xsl:value-of select="@id"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="generate-id()"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+        <fo:basic-link internal-destination="{$id}">
+          <xsl:value-of
+            select="substring('&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;',
0, 2 * $depth - 1)"/>
+          <fo:inline font-size="11pt">
+            <xsl:number count="section" format="1.1.1.1.1.1.1" level="multiple"/>
+          </fo:inline>
+          <xsl:text> </xsl:text>
+          <xsl:value-of select="title"/>
+          <fo:leader leader-pattern="dots"/>
+          <fo:page-number-citation ref-id="{$id}"/>
+        </fo:basic-link>
+      </fo:inline>
+      <xsl:if test="$toc-max-depth > $depth">
+        <xsl:apply-templates select="section" mode="toc">
+          <xsl:with-param name="depth" select="$depth + 1"/>
+        </xsl:apply-templates>
+      </xsl:if>
+    </fo:block>
+  </xsl:template>
 </xsl:stylesheet>

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-commonElements.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-commonElements.xsl?rev=628587&r1=628586&r2=628587&view=diff
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-commonElements.xsl
(original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-commonElements.xsl
Sun Feb 17 16:39:49 2008
@@ -522,60 +522,6 @@
       <xsl:apply-templates/>
     </fo:inline>
   </xsl:template>
-  <xsl:template match="body[count(//section) != 0]">
-    <xsl:if test="$disable-toc != 'true' and $toc-max-depth > 0">
-      <fo:block font-family="sans-serif" font-size="12pt" font-weight="bold"
-        space-after="5pt" space-before="5pt" text-align="justify" width="7.5in">
-        <xsl:call-template name="insertPageBreaks"/>
-        <!-- insert i18n stuff here -->
-        <xsl:text>Table of contents</xsl:text>
-      </fo:block>
-      <fo:block font-family="serif" font-size="12pt" space-after="5pt"
-        space-before="0pt" text-align="justify" width="7.5in">
-        <xsl:if test="$page-break-top-sections">
-          <xsl:attribute name="break-after">page</xsl:attribute>
-        </xsl:if>
-        <xsl:apply-templates select="section" mode="toc"/>
-      </fo:block>
-    </xsl:if>
-    <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template match="section" mode="toc">
-    <!-- FIXME: see bug FOR-640 -->
-    <xsl:param name="depth" select="'1'"/>
-    <fo:block space-before="5pt" text-align-last="justify" start-indent=".5em"
-      text-indent=".5em">
-      <fo:inline>
-        <xsl:variable name="id">
-          <xsl:choose>
-            <xsl:when test="normalize-space(@id)!=''">
-              <xsl:value-of select="@id"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="generate-id()"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:variable>
-        <fo:basic-link internal-destination="{$id}">
-          <xsl:value-of
-            select="substring('&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;',
0, 2 * $depth - 1)"/>
-          <fo:inline font-size="11pt">
-            <xsl:number count="section" format="1.1.1.1.1.1.1" level="multiple"/>
-          </fo:inline>
-          <xsl:text>
-          </xsl:text>
-          <xsl:value-of select="title"/>
-          <fo:leader leader-pattern="dots"/>
-          <fo:page-number-citation ref-id="{$id}"/>
-        </fo:basic-link>
-      </fo:inline>
-      <xsl:if test="$toc-max-depth > $depth">
-        <xsl:apply-templates select="section" mode="toc">
-          <xsl:with-param name="depth" select="$depth + 1"/>
-        </xsl:apply-templates>
-      </xsl:if>
-    </fo:block>
-  </xsl:template>
   
   <!-- ====================================================================== -->
   <!-- Local Extensions section -->

Added: forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-layout.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-layout.xsl?rev=628587&view=auto
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-layout.xsl
(added)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-layout.xsl
Sun Feb 17 16:39:49 2008
@@ -0,0 +1,103 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+  <!-- Determine page height for various page sizes (US Letter portrait
+  is the default) -->
+  <!-- FIXME: JJP:would this be better of a file? -->
+  <xsl:variable name="pageheight">
+    <xsl:choose>
+      <xsl:when test="$pageorientation = 'landscape'">
+        <xsl:choose>
+          <xsl:when test="$pagesize = 'a0'">841mm</xsl:when>
+          <xsl:when test="$pagesize = 'a1'">594mm</xsl:when>
+          <xsl:when test="$pagesize = 'a2'">420mm</xsl:when>
+          <xsl:when test="$pagesize = 'a3'">297mm</xsl:when>
+          <xsl:when test="$pagesize = 'a4'">210mm</xsl:when>
+          <xsl:when test="$pagesize = 'a5'">148mm</xsl:when>
+          <xsl:when test="$pagesize = 'executive'">7.25in</xsl:when>
+          <xsl:when test="$pagesize = 'folio'">8.5in</xsl:when>
+          <xsl:when test="$pagesize = 'ledger'">11in</xsl:when>
+          <xsl:when test="$pagesize = 'legal'">8.5in</xsl:when>
+          <xsl:when test="$pagesize = 'letter'">8.5in</xsl:when>
+          <xsl:when test="$pagesize = 'quarto'">8.5in</xsl:when>
+          <xsl:when test="$pagesize = 'tabloid'">11in</xsl:when>
+          <xsl:otherwise>8.5in</xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:choose>
+          <xsl:when test="$pagesize = 'a0'">1189mm</xsl:when>
+          <xsl:when test="$pagesize = 'a1'">841mm</xsl:when>
+          <xsl:when test="$pagesize = 'a2'">594mm</xsl:when>
+          <xsl:when test="$pagesize = 'a3'">420mm</xsl:when>
+          <xsl:when test="$pagesize = 'a4'">297mm</xsl:when>
+          <xsl:when test="$pagesize = 'a5'">210mm</xsl:when>
+          <xsl:when test="$pagesize = 'executive'">10.5in</xsl:when>
+          <xsl:when test="$pagesize = 'folio'">13in</xsl:when>
+          <xsl:when test="$pagesize = 'ledger'">17in</xsl:when>
+          <xsl:when test="$pagesize = 'legal'">14in</xsl:when>
+          <xsl:when test="$pagesize = 'quarto'">10.83in</xsl:when>
+          <xsl:when test="$pagesize = 'tabloid'">17in</xsl:when>
+          <xsl:otherwise>11in</xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  <!-- Determine page width for various page sizes (US Letter portrait
+  is the default) -->
+  <xsl:variable name="pagewidth">
+    <xsl:choose>
+      <xsl:when test="$pageorientation = 'landscape'">
+        <xsl:choose>
+          <xsl:when test="$pagesize = 'a0'">1189mm</xsl:when>
+          <xsl:when test="$pagesize = 'a1'">841mm</xsl:when>
+          <xsl:when test="$pagesize = 'a2'">594mm</xsl:when>
+          <xsl:when test="$pagesize = 'a3'">420mm</xsl:when>
+          <xsl:when test="$pagesize = 'a4'">297mm</xsl:when>
+          <xsl:when test="$pagesize = 'a5'">210mm</xsl:when>
+          <xsl:when test="$pagesize = 'executive'">10.5in</xsl:when>
+          <xsl:when test="$pagesize = 'folio'">13in</xsl:when>
+          <xsl:when test="$pagesize = 'ledger'">17in</xsl:when>
+          <xsl:when test="$pagesize = 'legal'">14in</xsl:when>
+          <xsl:when test="$pagesize = 'quarto'">10.83in</xsl:when>
+          <xsl:when test="$pagesize = 'tabloid'">17in</xsl:when>
+          <xsl:otherwise>11in</xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:choose>
+          <xsl:when test="$pagesize = 'a0'">841mm</xsl:when>
+          <xsl:when test="$pagesize = 'a1'">594mm</xsl:when>
+          <xsl:when test="$pagesize = 'a2'">420mm</xsl:when>
+          <xsl:when test="$pagesize = 'a3'">297mm</xsl:when>
+          <xsl:when test="$pagesize = 'a4'">210mm</xsl:when>
+          <xsl:when test="$pagesize = 'a5'">148mm</xsl:when>
+          <xsl:when test="$pagesize = 'executive'">7.25in</xsl:when>
+          <xsl:when test="$pagesize = 'folio'">8.5in</xsl:when>
+          <xsl:when test="$pagesize = 'ledger'">11in</xsl:when>
+          <xsl:when test="$pagesize = 'legal'">8.5in</xsl:when>
+          <xsl:when test="$pagesize = 'letter'">8.5in</xsl:when>
+          <xsl:when test="$pagesize = 'quarto'">8.5in</xsl:when>
+          <xsl:when test="$pagesize = 'tabloid'">11in</xsl:when>
+          <xsl:otherwise>8.5in</xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+</xsl:stylesheet>

Propchange: forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-layout.xsl
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message