forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r628561 - in /forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets: document-to-fo.xsl helper-pageBreaks.xsl helper-pageNumber.xsl
Date Sun, 17 Feb 2008 22:09:30 GMT
Author: thorsten
Date: Sun Feb 17 14:09:29 2008
New Revision: 628561

URL: http://svn.apache.org/viewvc?rev=628561&view=rev
Log:
Extracting matches to helper classes so that we can import them in other plugins

Added:
    forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-pageBreaks.xsl
  (with props)
    forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-pageNumber.xsl
  (with props)
Modified:
    forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.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=628561&r1=628560&r2=628561&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 14:09:29 2008
@@ -95,6 +95,10 @@
         href="pdfoutline.xsl" />
   <xsl:include
         href="footerinfo.xsl" />
+  <xsl:include
+        href="helper-pageBreaks.xsl" />
+  <xsl:include
+        href="helper-pageNumber.xsl" />
 <!-- Determine page height for various page sizes (US Letter portrait
   is the default) -->
 <!-- FIXME: JJP:would this be better of a file? -->
@@ -1442,69 +1446,6 @@
                 name="insertPageBreaks" />
       <xsl:apply-templates />
     </fo:block>
-  </xsl:template>
-  <xsl:template
-        name="insertPageBreaks">
-<!-- if marked as a 'pageBreakBefore', and we're breaking on pages, and were not the first
node -->
-    <xsl:if
-            test="contains(@class, 'pageBreakBefore') and preceding-sibling::node()">
-      <xsl:attribute
-                name="break-before">page</xsl:attribute>
-    </xsl:if>
-<!-- if marked as a 'pageBreakAfter', and we're breaking on pages, and were not the last
node -->
-    <xsl:if
-            test="contains(@class, 'pageBreakAfter') and following-sibling::node()">
-      <xsl:attribute
-                name="break-after">page</xsl:attribute>
-    </xsl:if>
-  </xsl:template>
-<!-- Display the document numerotation -->
-  <xsl:template
-        name="insertPageNumber">
-    <xsl:param
-            name="text-align"
-            select="'start'" />
-    <xsl:variable
-            name="prefixe"
-            select="substring-before($page-numbering-format,'1')" />
-    <xsl:variable
-            name="sep"
-            select="substring-before(substring-after($page-numbering-format,'1'),'1')" />
-    <xsl:variable
-            name="postfixe">
-      <xsl:choose>
-        <xsl:when
-                    test="contains(substring-after($page-numbering-format,'1'),'1')">
-          <xsl:value-of
-                        select="substring-after(substring-after($page-numbering-format,'1'),'1')"
/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of
-                        select="substring-after($page-numbering-format,'1')" />
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-<!-- if 'page-numbering-format' contains 1 digits, the page number is displayed in the
footer -->
-    <xsl:if
-            test="contains($page-numbering-format,'1')">
-      <fo:block
-                font-size="70%"
-                text-align="{$text-align}">
-<!-- if the separator is not found, the total page number is skipped -->
-        <xsl:value-of
-                    select="$prefixe" />
-        <fo:page-number />
-        <xsl:if
-                    test="$sep != ''">
-          <xsl:value-of
-                        select="$sep" />
-          <fo:page-number-citation
-                        ref-id="term" />
-        </xsl:if>
-        <xsl:value-of
-                    select="$postfixe" />
-      </fo:block>
-    </xsl:if>
   </xsl:template>
 <!-- ====================================================================== -->
 <!-- Temporary section - subject to change on short notice  -->

Added: forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-pageBreaks.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-pageBreaks.xsl?rev=628561&view=auto
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-pageBreaks.xsl
(added)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-pageBreaks.xsl
Sun Feb 17 14:09:29 2008
@@ -0,0 +1,33 @@
+<?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">
+  <xsl:template name="insertPageBreaks">
+    <!-- if marked as a 'pageBreakBefore', and we're breaking on pages, and were not the
first node -->
+    <xsl:if
+      test="contains(@class, 'pageBreakBefore') and preceding-sibling::node()">
+      <xsl:attribute name="break-before">page</xsl:attribute>
+    </xsl:if>
+    
+    <!-- if marked as a 'pageBreakAfter', and we're breaking on pages, and were not the
last node -->
+    <xsl:if
+      test="contains(@class, 'pageBreakAfter') and following-sibling::node()">
+      <xsl:attribute name="break-after">page</xsl:attribute>
+    </xsl:if>
+  </xsl:template>
+</xsl:stylesheet>

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

Added: forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-pageNumber.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-pageNumber.xsl?rev=628561&view=auto
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-pageNumber.xsl
(added)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/helper-pageNumber.xsl
Sun Feb 17 14:09:29 2008
@@ -0,0 +1,54 @@
+<?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">
+  <!-- Display the document numerotation -->
+  <xsl:template name="insertPageNumber">
+    <xsl:param name="text-align" select="'start'"/>
+    <xsl:variable name="prefixe"
+      select="substring-before($page-numbering-format,'1')"/>
+    <xsl:variable name="sep"
+      select="substring-before(substring-after($page-numbering-format,'1'),'1')"/>
+    <xsl:variable name="postfixe">
+      <xsl:choose>
+        <xsl:when
+          test="contains(substring-after($page-numbering-format,'1'),'1')">
+          <xsl:value-of
+            select="substring-after(substring-after($page-numbering-format,'1'),'1')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="substring-after($page-numbering-format,'1')"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    
+    <!-- if 'page-numbering-format' contains 1 digits, the page number is displayed in
the footer -->
+    <xsl:if test="contains($page-numbering-format,'1')">
+      <fo:block font-size="70%" text-align="{$text-align}">
+        <!-- if the separator is not found, the total page number is skipped -->
+        <xsl:value-of select="$prefixe"/>
+        <fo:page-number/>
+        <xsl:if test="$sep != ''">
+          <xsl:value-of select="$sep"/>
+          <fo:page-number-citation ref-id="term"/>
+        </xsl:if>
+        <xsl:value-of select="$postfixe"/>
+      </fo:block>
+    </xsl:if>
+  </xsl:template>
+</xsl:stylesheet>

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



Mime
View raw message