1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
Index: src/resources/skins/common/xslt/fo/pdfoutline.xsl
===================================================================
RCS file: /home/cvspublic/xml-forrest/src/resources/skins/common/xslt/fo/pdfoutline.xsl,v
retrieving revision 1.1
diff -u -r1.1 pdfoutline.xsl
--- src/resources/skins/common/xslt/fo/pdfoutline.xsl 3 Dec 2002 00:23:19 -0000 1.1
+++ src/resources/skins/common/xslt/fo/pdfoutline.xsl 3 Dec 2002 10:57:33 -0000
@@ -1,26 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE xsl:stylesheet [
-<!ENTITY copy "©">
-<!ENTITY nbsp " ">
-<!ENTITY degr "º">
-<!ENTITY sup2 "²">
-<!ENTITY sup3 "³">]>
-<xsl:stylesheet version="1.0" 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" xmlns:documentation="http://sealcorp.com.au/documentation">
+<xsl:stylesheet version="1.0" 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">
<xsl:template match="document" mode="outline">
- <fox:outline internal-destination="{generate-id()}">
- <fox:label>
- <xsl:value-of select="header/title"/>
- <xsl:text> - </xsl:text>
- <xsl:value-of select="header/authors/person/@name"/>
- </fox:label>
- <xsl:apply-templates select="body/section" mode="outline"/>
- </fox:outline>
+ <fox:bookmarks>
+ <fox:outline internal-destination="{generate-id()}">
+ <fox:label>
+ <xsl:value-of select="header/title"/>
+ </fox:label>
+ <xsl:apply-templates select="body/section" mode="outline"/>
+ </fox:outline>
+ </fox:bookmarks>
</xsl:template>
<xsl:template match="section" mode="outline">
<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 select="section" mode="outline"/>
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.3
diff -u -r1.3 document2fo.xsl
--- src/resources/skins/common/xslt/fo/document2fo.xsl 3 Dec 2002 00:23:19 -0000 1.3
+++ src/resources/skins/common/xslt/fo/document2fo.xsl 3 Dec 2002 10:57:33 -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"/>
@@ -84,14 +85,34 @@
</fo:layout-master-set>
<xsl:apply-templates select="/document" mode="outline"/>
-
+
<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 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>
@@ -106,6 +127,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">
@@ -114,6 +136,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">
@@ -135,6 +158,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">
@@ -198,6 +222,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>
@@ -212,6 +241,11 @@
<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>
@@ -240,8 +274,9 @@
space-before="20pt"
font-weight="bold"
font-size="9pt">
+ by
<xsl:for-each select="person">
- <xsl:value-of select="@name"/>, <xsl:value-of select="@email"/>
+ <xsl:value-of select="@name"/>
<xsl:if test="not(position() = last())">, </xsl:if>
</xsl:for-each>
</fo:block>
@@ -263,6 +298,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>
@@ -464,7 +502,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">
|