You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by st...@apache.org on 2002/12/03 01:23:19 UTC
cvs commit: xml-forrest/src/resources/skins/common/xslt/fo pdfoutline.xsl document2fo.xsl
stevenn 2002/12/02 16:23:19
Modified: src/resources/skins/common/xslt/fo document2fo.xsl
Added: src/resources/skins/common/xslt/fo pdfoutline.xsl
Log:
Patch from Perry Molendijk <xi...@iinet.net.au> to build PDF bookmarks.
Revision Changes Path
1.3 +10 -4 xml-forrest/src/resources/skins/common/xslt/fo/document2fo.xsl
Index: document2fo.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/skins/common/xslt/fo/document2fo.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- document2fo.xsl 16 Nov 2002 22:58:50 -0000 1.2
+++ document2fo.xsl 3 Dec 2002 00:23:19 -0000 1.3
@@ -6,6 +6,8 @@
<xsl:output method="xml"/>
+ <xsl:include href="pdfoutline.xsl"/>
+
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
@@ -80,6 +82,8 @@
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
+
+ <xsl:apply-templates select="/document" mode="outline"/>
<fo:page-sequence master-reference="book">
<xsl:apply-templates/>
@@ -151,7 +155,9 @@
padding-before="24pt"
padding-after="24pt"
font-size="24pt"
- font-weight="bold">
+ font-weight="bold"
+ id="{generate-id()}">
+
<xsl:value-of select="header/title"/>
</fo:block>
@@ -201,7 +207,9 @@
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:value-of select="title"/>
@@ -591,5 +599,3 @@
</xsl:stylesheet>
-
-
1.1 xml-forrest/src/resources/skins/common/xslt/fo/pdfoutline.xsl
Index: pdfoutline.xsl
===================================================================
<?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: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>
</xsl:template>
<xsl:template match="section" mode="outline">
<fox:outline internal-destination="{generate-id()}">
<fox:label>
<xsl:value-of select="title"/>
</fox:label>
<xsl:apply-templates select="section" mode="outline"/>
</fox:outline>
</xsl:template>
</xsl:stylesheet>