[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: fox:outline - Patch to get with DocBook stylesheets with FOP 0.92working
Hello, I have here a patch, which replaces the fox:outline elements with fo:bookmarktree and it subelements. Otherwise the FO file cannot be compiled to a PDF with Fop 0.92. Maybe can also be used in a custom stylesheet. Is there a better fix? Is it possible to get the fop version and branch accordingly? Unfortunately the bookmarks in the bookmarklist of Acrobat Reader are missing, don't know how to fix it, but at least my footnotes are rendered correctly with fop 0.92. Regards, Karsten <?xml version='1.0' encoding="utf-8"?> <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'> <!-- ******************************************************************** $Id: fop.xsl,v 1.10 2005/04/20 08:11:36 bobstayton Exp $ ******************************************************************** (c) Stephane Bline Peregrine Systems 2001 Driver file to allow pdf bookmarking (based on fop implementation). ******************************************************************** --> <!-- In PDF bookmarks can't be used characters with code>255. This version of file translates characters with code>255 back to ASCII. Pavel Zampach (zampach@volny.cz) --> <xsl:variable name="a-dia" select= "'āăąćĉċčďđēĕėęěœĝğġģĥħĩīĭįıĵķĺļľŀłńņňŋōŏőŕŗřśŝşšţťŧũūŭůűųŵŷźżžĀĂĄĆĈĊČĎĐĒĔĖĘĚŒĜĞĠĢĤĦĨĪĬĮİĴĶĹĻĽĿŁŃŅŇŊŌŎŐŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸŹŻŽ'"/> <xsl:variable name="a-asc" select= "'aaaccccddeeeeeegggghhiiiiijklllllnnnnooorrrsssstttuuuuuuwyzzzAAACCCCDDEEEEEEGGGGHHIIIIIJKLLLLLNNNNOOORRRSSSSTTTUUUUUUWYYZZZ'"/> <xsl:template match="*" mode="fop.outline"> <xsl:if test="@id"> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="bookmark-label"> <xsl:apply-templates select="." mode="object.title.markup"/> </xsl:variable> <fo:bookmark internal-destination="{$id}"> <fo:bookmark-title> <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/> </fo:bookmark-title> </fo:bookmark> <xsl:apply-templates select="*" mode="fop.outline"/> </xsl:if> </xsl:template> <xsl:template match="set|book|part|reference|preface|chapter|appendix|article |glossary|bibliography|index|setindex |refentry |sect1|sect2|sect3|sect4|sect5|section" mode="fop.outline"> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="bookmark-label"> <xsl:apply-templates select="." mode="object.title.markup"/> </xsl:variable> <!-- Put the root element bookmark at the same level as its children --> <!-- If the object is a set or book, generate a bookmark for the toc --> <xsl:choose> <xsl:when test="parent::*"> <fo:bookmark internal-destination="{$id}"> <fo:bookmark-title> <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/> </fo:bookmark-title> <xsl:apply-templates select="*" mode="fop.outline"/> </fo:bookmark> </xsl:when> <xsl:otherwise> <fo:bookmark-tree> <fo:bookmark internal-destination="{$id}"> <fo:bookmark-title> <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/> </fo:bookmark-title> </fo:bookmark> <xsl:variable name="toc.params"> <xsl:call-template name="find.path.params"> <xsl:with-param name="table" select="normalize-space($generate.toc)"/> </xsl:call-template> </xsl:variable> <xsl:if test="contains($toc.params, 'toc') and (book|part|reference|preface|chapter|appendix|article |glossary|bibliography|index|setindex |refentry |sect1|sect2|sect3|sect4|sect5|section)"> <fo:bookmark internal-destination="toc...{$id}"> <fo:bookmark-title> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'TableofContents'"/> </xsl:call-template> </fo:bookmark-title> </fo:bookmark> </xsl:if> <xsl:apply-templates select="*" mode="fop.outline"/> </fo:bookmark-tree> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]