From: Paul V. <pau...@us...> - 2005-02-11 16:01:46
|
Update of /cvsroot/firebird/manual/src/docs/xsl/fo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3535/src/docs/xsl/fo Modified Files: component.xsl lists.xsl titlepage.templates.xsl Added Files: block.xsl titlepage.xsl Log Message: Numerous improvements and additions to stylesheets --- block.xsl ADDED --- --- titlepage.xsl ADDED --- Index: component.xsl =================================================================== RCS file: /cvsroot/firebird/manual/src/docs/xsl/fo/component.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -b -U3 -r1.1 -r1.2 --- component.xsl 30 Sep 2004 15:45:42 -0000 1.1 +++ component.xsl 11 Feb 2005 16:01:29 -0000 1.2 @@ -33,9 +33,10 @@ select="title|subtitle|titleabbrev|artheader|articleinfo"/> <xsl:variable name="content" - select="*[not(self::title or self::subtitle + select="*[not(self::title + or self::subtitle or self::titleabbrev - or self::articleinfo + or self::artheader or self::articleinfo or self::index)]"/> @@ -173,7 +174,7 @@ </xsl:if> - <!-- copied from default article template (but removed article.titlepage + <!-- copied from default article template, but removed article.titlepage and toc stuff, changed apply-templates to apply-templates select="$content", and leave initial-page-number to auto (implicitly) if double.sided is false: --> @@ -322,6 +323,8 @@ </xsl:template> + + <!-- By default, appendices have their own page-sequence. This is not the case for article/appendix. But at least we want it to start on a fresh page! --> @@ -332,7 +335,12 @@ </xsl:variable> <xsl:variable name="title"> - <xsl:apply-templates select="." mode="title.markup"/> + <xsl:apply-templates select="." mode="title.markup"> + <xsl:with-param name="allow-anchors" select="1"/> + <!-- allow-anchors 1 is our addition. Without it, + indexterms within article/appendix/title will lead to + broken index entries --> + </xsl:apply-templates> </xsl:variable> <xsl:variable name="titleabbrev"> @@ -376,4 +384,6 @@ </fo:block> </xsl:template> + + </xsl:stylesheet> Index: lists.xsl =================================================================== RCS file: /cvsroot/firebird/manual/src/docs/xsl/fo/lists.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -b -U3 -r1.1 -r1.2 --- lists.xsl 30 Sep 2004 15:45:42 -0000 1.1 +++ lists.xsl 11 Feb 2005 16:01:29 -0000 1.2 @@ -104,6 +104,20 @@ </xsl:call-template> </xsl:variable> + <!-- paulvink: Our addition: + more distance needed between label start and body start if + enclosing list's numbers are inherited: --> + <xsl:variable name="prov-dist"> + <xsl:choose> + <xsl:when test="$label-width != ''"> + <xsl:value-of select="$label-width"/> + </xsl:when> + <!-- Could refine the following further: how many inheritnum levels? --> + <xsl:when test="@inheritnum='inherit' and ancestor::listitem[parent::orderedlist]">3em</xsl:when> + <xsl:otherwise>2em</xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:if test="title"> <xsl:apply-templates select="title" mode="list.title.mode"/> </xsl:if> @@ -116,18 +130,11 @@ |comment()[not(preceding-sibling::listitem)] |processing-instruction()[not(preceding-sibling::listitem)]"/> - <xsl:choose> <xsl:when test="$effspacing='compact' and ancestor::*[@spacing][1]/@spacing = 'compact'"> - <fo:list-block id="{$id}" provisional-label-separation="0.2em"> - <xsl:attribute name="provisional-distance-between-starts"> - <xsl:choose> - <xsl:when test="$label-width != ''"> - <xsl:value-of select="$label-width"/> - </xsl:when> - <xsl:otherwise>2em</xsl:otherwise> - </xsl:choose> - </xsl:attribute> + <fo:list-block id="{$id}" + provisional-label-separation="0.2em" + provisional-distance-between-starts="{$prov-dist}"> <xsl:apply-templates select="listitem |comment()[preceding-sibling::listitem] @@ -135,16 +142,10 @@ </fo:list-block> </xsl:when> <xsl:otherwise> - <fo:list-block id="{$id}" xsl:use-attribute-sets="list.block.spacing" - provisional-label-separation="0.2em"> - <xsl:attribute name="provisional-distance-between-starts"> - <xsl:choose> - <xsl:when test="$label-width != ''"> - <xsl:value-of select="$label-width"/> - </xsl:when> - <xsl:otherwise>2em</xsl:otherwise> - </xsl:choose> - </xsl:attribute> + <fo:list-block id="{$id}" + xsl:use-attribute-sets="list.block.spacing" + provisional-label-separation="0.2em" + provisional-distance-between-starts="{$prov-dist}"> <xsl:apply-templates select="listitem |comment()[preceding-sibling::listitem] Index: titlepage.templates.xsl =================================================================== RCS file: /cvsroot/firebird/manual/src/docs/xsl/fo/titlepage.templates.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -b -U3 -r1.1 -r1.2 --- titlepage.templates.xsl 30 Sep 2004 15:45:42 -0000 1.1 +++ titlepage.templates.xsl 11 Feb 2005 16:01:29 -0000 1.2 @@ -95,7 +95,122 @@ </xsl:template> + <!-- LEGALNOTICES --> -</xsl:stylesheet> + <xsl:template match="legalnotice" mode="article.titlepage.recto.auto.mode"> + <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" + xsl:use-attribute-sets="article.titlepage.recto.style" + text-align="justify" + font-family="{$body.fontset}"> + <!-- original block attributes were: + xsl:use-attribute-sets="article.titlepage.recto.style" + text-align="start" + margin-left="0.5in" + margin-right="0.5in" + font-family="{$body.fontset}" + --> + <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> + </fo:block> + </xsl:template> + + + <xsl:template match="legalnotice" mode="book.titlepage.verso.auto.mode"> + <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" + xsl:use-attribute-sets="book.titlepage.verso.style"> + <!-- original block attributes were: + xsl:use-attribute-sets="book.titlepage.verso.style" + font-size="8pt" + --> + <xsl:apply-templates select="." mode="book.titlepage.verso.mode"/> + </fo:block> + </xsl:template> + + + <!-- + In the original stylesheet, the error is made that <revision> is + mentioned instead of <edition>. We fix it here for article but in + fact _all_ the templates have got this wrong. + + Maybe we should edit titlepage.templates.xml and generate a whole + new titlepage.templates.xsl ! + --> + <xsl:template name="article.titlepage.recto"> + <xsl:choose> + <xsl:when test="articleinfo/title"> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/title"/> + </xsl:when> + <xsl:when test="artheader/title"> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/title"/> + </xsl:when> + <xsl:when test="info/title"> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/title"/> + </xsl:when> + <xsl:when test="title"> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="title"/> + </xsl:when> + </xsl:choose> + + <xsl:choose> + <xsl:when test="articleinfo/subtitle"> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/subtitle"/> + </xsl:when> + <xsl:when test="artheader/subtitle"> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/subtitle"/> + </xsl:when> + <xsl:when test="info/subtitle"> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/subtitle"/> + </xsl:when> + <xsl:when test="subtitle"> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="subtitle"/> + </xsl:when> + </xsl:choose> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/corpauthor"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/corpauthor"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/corpauthor"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/authorgroup"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/authorgroup"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/authorgroup"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/author"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/author"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/author"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/othercredit"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/othercredit"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/othercredit"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/releaseinfo"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/releaseinfo"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/releaseinfo"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/copyright"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/copyright"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/copyright"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/legalnotice"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/legalnotice"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/legalnotice"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/pubdate"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/pubdate"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/pubdate"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/edition"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/edition"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/edition"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revhistory"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/revhistory"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/revhistory"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/abstract"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/abstract"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/abstract"/> + </xsl:template> + + + <xsl:template match="edition" mode="article.titlepage.recto.auto.mode"> + <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" + xsl:use-attribute-sets="article.titlepage.recto.style" + space-before="0.5em"> + <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> + </fo:block> + </xsl:template> + + + + +</xsl:stylesheet> |