root/docs/docbook-xsl/fo/fo-patch-for-fop.xsl

Revision 23dea7e00df87480acb58bb3398283c2bb227949, 2.1 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 8 years ago)

pull docs into master

  • Property mode set to 100644
Line 
1 <?xml version="1.0"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
4                 xmlns:fox="http://xml.apache.org/fop/extensions"
5                 version="1.0">
6
7 <!-- ********************************************************************
8      $Id: fo-patch-for-fop.xsl,v 1.5 2002/06/11 13:38:03 nwalsh Exp $
9      ********************************************************************
10
11      This file is part of the DocBook XSL Stylesheet distribution.
12      See ../README or http://docbook.sf.net/ for copyright
13      and other information.
14
15      ******************************************************************** -->
16
17 <xsl:output method="xml"/>
18
19 <xsl:template match="*">
20   <xsl:element name="{name(.)}">
21     <xsl:copy-of select="@*"/>
22     <xsl:apply-templates/>
23   </xsl:element>
24 </xsl:template>
25
26 <xsl:template match="fo:page-sequence
27                      |fo:single-page-master-reference
28                      |fo:repeatable-page-master-reference
29                      |fo:conditional-page-master-reference">
30   <xsl:element name="{name(.)}">
31     <xsl:for-each select="@*">
32       <xsl:choose>
33         <xsl:when test="name(.) = 'master-reference'">
34           <xsl:attribute name="master-name">
35             <xsl:value-of select="."/>
36           </xsl:attribute>
37         </xsl:when>
38         <xsl:otherwise>
39           <xsl:attribute name="{name(.)}">
40             <xsl:value-of select="."/>
41           </xsl:attribute>
42         </xsl:otherwise>
43       </xsl:choose>
44     </xsl:for-each>
45     <xsl:apply-templates/>
46   </xsl:element>
47 </xsl:template>
48
49 <!-- a clever idea that doesn't quite work. fop 0.20.1 doesn't understand % -->
50 <!-- and fop 0.20.2 doesn't work for me at all... -->
51 <xsl:template match="fo:table-column">
52   <xsl:element name="{name(.)}">
53     <xsl:if test="not(@column-width)">
54       <xsl:attribute name="column-width">
55         <xsl:value-of select="100 div count(../fo:table-column)"/>
56         <xsl:text>%</xsl:text>
57       </xsl:attribute>
58     </xsl:if>
59     <xsl:copy-of select="@*"/>
60     <xsl:apply-templates/>
61   </xsl:element>
62 </xsl:template>
63
64 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.