fo.xsl 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. version='1.0'>
  5. <!-- ********************************************************************
  6. $Id$
  7. ********************************************************************
  8. This file is part of the XSL DocBook Stylesheet distribution.
  9. See ../README or http://docbook.sf.net/release/xsl/current/ for
  10. copyright and other information.
  11. ******************************************************************** -->
  12. <xsl:template name="anchor">
  13. <xsl:param name="node" select="."/>
  14. <xsl:param name="conditional" select="1"/>
  15. <xsl:variable name="id">
  16. <xsl:call-template name="object.id">
  17. <xsl:with-param name="object" select="$node"/>
  18. </xsl:call-template>
  19. </xsl:variable>
  20. <xsl:if test="$conditional = 0 or $node/@id or $node/@xml:id">
  21. <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
  22. </xsl:if>
  23. </xsl:template>
  24. <xsl:template name="dingbat">
  25. <xsl:param name="dingbat">bullet</xsl:param>
  26. <xsl:variable name="symbol">
  27. <xsl:choose>
  28. <xsl:when test="$dingbat='bullet'">o</xsl:when>
  29. <xsl:when test="$dingbat='copyright'">&#x00A9;</xsl:when>
  30. <xsl:when test="$dingbat='trademark'">&#x2122;</xsl:when>
  31. <xsl:when test="$dingbat='trade'">&#x2122;</xsl:when>
  32. <xsl:when test="$dingbat='registered'">&#x00AE;</xsl:when>
  33. <xsl:when test="$dingbat='service'">(SM)</xsl:when>
  34. <xsl:when test="$dingbat='ldquo'">"</xsl:when>
  35. <xsl:when test="$dingbat='rdquo'">"</xsl:when>
  36. <xsl:when test="$dingbat='lsquo'">'</xsl:when>
  37. <xsl:when test="$dingbat='rsquo'">'</xsl:when>
  38. <xsl:when test="$dingbat='em-dash'">&#x2014;</xsl:when>
  39. <xsl:when test="$dingbat='en-dash'">-</xsl:when>
  40. <xsl:otherwise>o</xsl:otherwise>
  41. </xsl:choose>
  42. </xsl:variable>
  43. <xsl:choose>
  44. <xsl:when test="$dingbat.font.family = ''">
  45. <xsl:copy-of select="$symbol"/>
  46. </xsl:when>
  47. <xsl:otherwise>
  48. <fo:inline font-family="{$dingbat.font.family}">
  49. <xsl:copy-of select="$symbol"/>
  50. </fo:inline>
  51. </xsl:otherwise>
  52. </xsl:choose>
  53. </xsl:template>
  54. <xsl:template name="href.target">
  55. <xsl:param name="context" select="."/>
  56. <xsl:param name="object" select="."/>
  57. <xsl:text>#</xsl:text>
  58. <xsl:call-template name="object.id">
  59. <xsl:with-param name="object" select="$object"/>
  60. </xsl:call-template>
  61. </xsl:template>
  62. </xsl:stylesheet>