<commit_before>Index: src/resources/skins/common/xslt/fo/document2fo.xsl
===================================================================
RCS file: /home/cvspublic/xml-forrest/src/resources/skins/common/xslt/fo/document2fo.xsl,v
retrieving revision 1.2
diff -u -r1.2 document2fo.xsl
--- src/resources/skins/common/xslt/fo/document2fo.xsl	16 Nov 2002 22:58:50 -0000	1.2
+++ src/resources/skins/common/xslt/fo/document2fo.xsl	18 Nov 2002 14:09:29 -0000
@@ -2,6 +2,7 @@
 
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                xmlns:fox="http://xml.apache.org/fop/extensions"
                 version="1.0">
 
   <xsl:output method="xml"/>
@@ -80,14 +81,52 @@
           </fo:repeatable-page-master-alternatives>
         </fo:page-sequence-master>
       </fo:layout-master-set>
-      
+
+      <fox:bookmarks>
+        <xsl:apply-templates select="document/body/section" mode="bookmarks"/>
+      </fox:bookmarks>
+
       <fo:page-sequence master-reference="book">
         <xsl:apply-templates/>
       </fo:page-sequence>
       
     </fo:root>
   </xsl:template>
-  
+
+  <xsl:template match="section" mode="bookmarks">
+    <fox:outline internal-destination="{generate-id()}">
+      <fox:label>
+        <xsl:number format="1.1.1.1.1.1.1" count="section" level="multiple"/>
+        <xsl:text> </xsl:text>
+        <xsl:value-of select="title"/>
+      </fox:label>
+      <xsl:apply-templates mode="bookmarks"/>
+    </fox:outline>
+  </xsl:template>
+
+  <xsl:template match="*" mode="bookmarks">
+    <xsl:apply-templates mode="bookmarks"/>
+  </xsl:template>
+
+  <xsl:template name="info">
+    <fo:block-container font-style="italic" absolute-position="absolute"
+              left="0pt" top="0pt" right="6.25in" bottom="150pt"
+              font-size="10pt">
+      <fo:block text-align="center">
+        <fo:basic-link color="lightgrey"
+                       external-destination="http://xml.apache.org/fop/dev">
+          Created by: FOP 1.0dev
+        </fo:basic-link>
+      </fo:block>
+      <fo:block text-align="center">
+        <fo:basic-link color="lightgrey"
+                       external-destination="http://xml.apache.org/fop/dev">
+          http://xml.apache.org/fop/dev
+        </fo:basic-link>
+      </fo:block>
+    </fo:block-container>
+  </xsl:template>
+
   <xsl:template match="document">
     <fo:title><xsl:value-of select="header/title"/></fo:title>
     
@@ -102,6 +141,7 @@
         text-align="start">
         Page <fo:page-number/>
       </fo:block>
+      <xsl:call-template name="info"/>
     </fo:static-content>
 
     <fo:static-content flow-name="even-header">
@@ -110,6 +150,7 @@
         font-style="italic">
         <xsl:value-of select="header/title"/>
       </fo:block>
+      <xsl:call-template name="info"/>
     </fo:static-content>
 
     <fo:static-content flow-name="even-footer">
@@ -131,6 +172,7 @@
         font-style="italic">
         <xsl:value-of select="header/title"/>
       </fo:block>
+      <xsl:call-template name="info"/>
     </fo:static-content>
     
     <fo:static-content flow-name="odd-footer">
@@ -192,6 +234,11 @@
     </fo:block>
   </xsl:template>
 
+  <xsl:template match="anchor">
+    <fo:block id="{@id}"/>
+    <xsl:apply-templates/>
+  </xsl:template>
+
   <xsl:template match="section">
     
     <xsl:param name="level">0</xsl:param>
@@ -201,9 +248,15 @@
       font-family="serif"
       font-size="{$size}pt"
       font-weight="bold"
-      space-before="12pt">
+      space-before="12pt"
+      id="{generate-id()}">
       <xsl:number format="1.1.1.1.1.1.1" count="section" level="multiple"/>
       <xsl:text> </xsl:text>
+
+      <xsl:if test="normalize-space(@id)!=''">
+        <fo:block id="{@id}"/>
+      </xsl:if>
+
       <xsl:value-of select="title"/>
     </fo:block>
     <xsl:apply-templates>
@@ -255,6 +308,9 @@
       font-size="10pt"
       background-color="#f0f0f0"
       white-space-collapse="false"
+      linefeed-treatment="preserve"
+      white-space-treatment="preserve"
+      wrap-option="no-wrap"
       text-align="start">
       <xsl:apply-templates/>
     </fo:block>
@@ -456,7 +512,16 @@
   </xsl:template>
 
   <xsl:template match="link">
+    <xsl:choose>
+      <xsl:when test="starts-with(@href, '#')">
+    <fo:basic-link color="blue" text-decoration="underline" internal-destination="{substring(@href,2)}">
+      <xsl:apply-templates/>
+    </fo:basic-link>
+      </xsl:when>
+      <xsl:otherwise>
     <fo:basic-link color="blue" text-decoration="underline" external-destination="{@href}"><xsl:apply-templates/></fo:basic-link>
+      </xsl:otherwise>
+    </xsl:choose>
   </xsl:template>
 
   <xsl:template match="figure">
@@ -587,7 +652,6 @@
      [<xsl:value-of select="@def"/>]
    </fo:inline>
  </xsl:template>
-
 
 
 </xsl:stylesheet><commit_msg>suppress text nodes in bookmarks added page sequence title<commit_after>Index: src/resources/skins/common/xslt/fo/document2fo.xsl
===================================================================
RCS file: /home/cvspublic/xml-forrest/src/resources/skins/common/xslt/fo/document2fo.xsl,v
retrieving revision 1.2
diff -u -r1.2 document2fo.xsl
--- src/resources/skins/common/xslt/fo/document2fo.xsl	16 Nov 2002 22:58:50 -0000	1.2
+++ src/resources/skins/common/xslt/fo/document2fo.xsl	19 Nov 2002 07:30:58 -0000
@@ -2,6 +2,7 @@
 
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                xmlns:fox="http://xml.apache.org/fop/extensions"
                 version="1.0">
 
   <xsl:output method="xml"/>
@@ -80,14 +81,57 @@
           </fo:repeatable-page-master-alternatives>
         </fo:page-sequence-master>
       </fo:layout-master-set>
-      
+
+      <fox:bookmarks>
+        <xsl:apply-templates select="document/body/section" mode="bookmarks"/>
+      </fox:bookmarks>
+
       <fo:page-sequence master-reference="book">
+        <fo:title><xsl:value-of select="document/header/title"/></fo:title>
         <xsl:apply-templates/>
       </fo:page-sequence>
       
     </fo:root>
   </xsl:template>
-  
+
+  <xsl:template match="section" mode="bookmarks">
+    <fox:outline internal-destination="{generate-id()}">
+      <fox:label>
+        <xsl:number format="1.1.1.1.1.1.1" count="section" level="multiple"/>
+        <xsl:text> </xsl:text>
+        <xsl:value-of select="title"/>
+      </fox:label>
+      <xsl:apply-templates mode="bookmarks"/>
+    </fox:outline>
+  </xsl:template>
+
+  <xsl:template match="*" mode="bookmarks">
+    <xsl:apply-templates mode="bookmarks"/>
+  </xsl:template>
+
+  <xsl:template match="text()" mode="bookmarks">
+    <!-- suppress text nodes in bookmarks -->
+  </xsl:template>
+
+  <xsl:template name="info">
+    <fo:block-container font-style="italic" absolute-position="absolute"
+              left="0pt" top="0pt" right="6.25in" bottom="150pt"
+              font-size="10pt">
+      <fo:block text-align="center">
+        <fo:basic-link color="lightgrey"
+                       external-destination="http://xml.apache.org/fop/dev">
+          Created by: FOP 1.0dev
+        </fo:basic-link>
+      </fo:block>
+      <fo:block text-align="center">
+        <fo:basic-link color="lightgrey"
+                       external-destination="http://xml.apache.org/fop/dev">
+          http://xml.apache.org/fop/dev
+        </fo:basic-link>
+      </fo:block>
+    </fo:block-container>
+  </xsl:template>
+
   <xsl:template match="document">
     <fo:title><xsl:value-of select="header/title"/></fo:title>
     
@@ -102,6 +146,7 @@
         text-align="start">
         Page <fo:page-number/>
       </fo:block>
+      <xsl:call-template name="info"/>
     </fo:static-content>
 
     <fo:static-content flow-name="even-header">
@@ -110,6 +155,7 @@
         font-style="italic">
         <xsl:value-of select="header/title"/>
       </fo:block>
+      <xsl:call-template name="info"/>
     </fo:static-content>
 
     <fo:static-content flow-name="even-footer">
@@ -131,6 +177,7 @@
         font-style="italic">
         <xsl:value-of select="header/title"/>
       </fo:block>
+      <xsl:call-template name="info"/>
     </fo:static-content>
     
     <fo:static-content flow-name="odd-footer">
@@ -192,6 +239,11 @@
     </fo:block>
   </xsl:template>
 
+  <xsl:template match="anchor">
+    <fo:block id="{@id}"/>
+    <xsl:apply-templates/>
+  </xsl:template>
+
   <xsl:template match="section">
     
     <xsl:param name="level">0</xsl:param>
@@ -201,9 +253,15 @@
       font-family="serif"
       font-size="{$size}pt"
       font-weight="bold"
-      space-before="12pt">
+      space-before="12pt"
+      id="{generate-id()}">
       <xsl:number format="1.1.1.1.1.1.1" count="section" level="multiple"/>
       <xsl:text> </xsl:text>
+
+      <xsl:if test="normalize-space(@id)!=''">
+        <fo:block id="{@id}"/>
+      </xsl:if>
+
       <xsl:value-of select="title"/>
     </fo:block>
     <xsl:apply-templates>
@@ -255,6 +313,9 @@
       font-size="10pt"
       background-color="#f0f0f0"
       white-space-collapse="false"
+      linefeed-treatment="preserve"
+      white-space-treatment="preserve"
+      wrap-option="no-wrap"
       text-align="start">
       <xsl:apply-templates/>
     </fo:block>
@@ -456,7 +517,16 @@
   </xsl:template>
 
   <xsl:template match="link">
+    <xsl:choose>
+      <xsl:when test="starts-with(@href, '#')">
+    <fo:basic-link color="blue" text-decoration="underline" internal-destination="{substring(@href,2)}">
+      <xsl:apply-templates/>
+    </fo:basic-link>
+      </xsl:when>
+      <xsl:otherwise>
     <fo:basic-link color="blue" text-decoration="underline" external-destination="{@href}"><xsl:apply-templates/></fo:basic-link>
+      </xsl:otherwise>
+    </xsl:choose>
   </xsl:template>
 
   <xsl:template match="figure">
{'fraction_non_alphanumeric': 0.21795129804789695, 'fraction_numerical': 0.03360837190581606, 'mean_word_length': 2.7548167737060822, 'pattern_counts': {'":': 0, '<': 201, '<?xml version=': 0, '>': 213, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 18}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '220590', 'n_tokens_mistral': 3851, 'n_tokens_neox': 3456, 'n_words': 457}