home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _B8B4AEF91CD04FA485E96A6B87991B92 < prev    next >
Encoding:
Extensible Markup Language  |  2002-09-04  |  2.2 KB  |  65 lines

  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.1.2.1 2002/09/04 14:25:06 jdj 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>
  65.