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

  1. <?xml version='1.0' encoding="utf-8"?>
  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: fop.xsl,v 1.1.2.1 2002/09/04 14:25:11 jdj Exp $
  9.      ********************************************************************
  10.      (c) Stephane Bline Peregrine Systems 2001
  11.      Driver file to allow pdf bookmarking (based on fop implementation).
  12.      ******************************************************************** -->
  13. <!--
  14. In PDF bookmarks can't be used characters with code>255. This version of file
  15. translates characters with code>255 back to ASCII.
  16.  
  17.    Pavel Zampach (zampach@volny.cz)
  18. -->
  19.  
  20. <xsl:variable name="a-dia" select=
  21. "'āăąćĉċčďđēĕėęěœĝğġģĥħĩīĭįıĵķĺļľŀłńņňŋōŏőŕŗřśŝşšţťŧũūŭůűųŵŷźżžĀĂĄĆĈĊČĎĐĒĔĖĘĚŒĜĞĠĢĤĦĨĪĬĮİĴĶĹĻĽĿŁŃŅŇŊŌŎŐŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸŹŻŽ'"/>
  22. <xsl:variable name="a-asc" select=
  23. "'aaaccccddeeeeeegggghhiiiiijklllllnnnnooorrrsssstttuuuuuuwyzzzAAACCCCDDEEEEEEGGGGHHIIIIIJKLLLLLNNNNOOORRRSSSSTTTUUUUUUWYYZZZ'"/>
  24.  
  25. <xsl:template match="*" mode="fop.outline">
  26.   <xsl:apply-templates select="*" mode="fop.outline"/>
  27. </xsl:template>
  28.  
  29. <xsl:template match="set|book|part|reference|preface|chapter|appendix|article
  30.                      |glossary|bibliography|index|setindex
  31.                      |refentry
  32.                      |sect1|sect2|sect3|sect4|sect5|section"
  33.               mode="fop.outline">
  34.   <xsl:variable name="id">
  35.     <xsl:call-template name="object.id"/>
  36.   </xsl:variable>
  37.   <xsl:variable name="bookmark-label">
  38.     <xsl:apply-templates select="." mode="object.title.markup"/>
  39.   </xsl:variable>
  40.  
  41.   <!-- Put the root element bookmark at the same level as its children -->
  42.   <!-- If the object is a set or book, generate a bookmark for the toc -->
  43.  
  44.   <xsl:choose>
  45.     <xsl:when test="parent::*">
  46.       <fox:outline internal-destination="{$id}">
  47.         <fox:label>
  48.           <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
  49.         </fox:label>
  50.         <xsl:apply-templates select="*" mode="fop.outline"/>
  51.       </fox:outline>
  52.     </xsl:when>
  53.     <xsl:otherwise>
  54.       <fox:outline internal-destination="{$id}">
  55.         <fox:label>
  56.           <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
  57.         </fox:label>
  58.       </fox:outline>
  59.  
  60.       <xsl:variable name="toc.params">
  61.         <xsl:call-template name="find.path.params">
  62.           <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  63.         </xsl:call-template>
  64.       </xsl:variable>
  65.       <xsl:if test="contains($toc.params, 'toc')
  66.                     and section|sect1|refentry
  67.                         |article|bibliography|glossary
  68.                         |appendix">
  69.         <fox:outline internal-destination="toc...{$id}">
  70.           <fox:label>
  71.             <xsl:call-template name="gentext">
  72.               <xsl:with-param name="key" select="'TableofContents'"/>
  73.             </xsl:call-template>
  74.           </fox:label>
  75.         </fox:outline>
  76.       </xsl:if>
  77.       <xsl:apply-templates select="*" mode="fop.outline"/>
  78.     </xsl:otherwise>
  79.   </xsl:choose>
  80. </xsl:template>
  81.  
  82. </xsl:stylesheet>
  83.  
  84.