[c873d807] | 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 | <!-- ********************************************************************
|
---|
[15c7d39] | 7 | $Id: fo.xsl 9720 2013-01-31 18:24:47Z bobstayton $
|
---|
[c873d807] | 8 | ********************************************************************
|
---|
| 9 |
|
---|
| 10 | This file is part of the XSL DocBook Stylesheet distribution.
|
---|
| 11 | See ../README or http://docbook.sf.net/release/xsl/current/ for
|
---|
| 12 | copyright and other information.
|
---|
| 13 |
|
---|
| 14 | ******************************************************************** -->
|
---|
| 15 |
|
---|
[15c7d39] | 16 | <!-- These variables set the margin-left or -right attribute value for FO output based on
|
---|
| 17 | the writing-mode specified in the gentext file for the document's lang. -->
|
---|
| 18 |
|
---|
| 19 | <xsl:param name="direction.align.start">
|
---|
| 20 | <xsl:choose>
|
---|
| 21 | <!-- FOP does not support writing-mode="rl-tb" -->
|
---|
| 22 | <xsl:when test="$fop.extensions != 0">left</xsl:when>
|
---|
| 23 | <xsl:when test="$fop1.extensions != 0">left</xsl:when>
|
---|
| 24 | <xsl:when test="starts-with($writing.mode, 'lr')">left</xsl:when>
|
---|
| 25 | <xsl:when test="starts-with($writing.mode, 'rl')">right</xsl:when>
|
---|
| 26 | <xsl:when test="starts-with($writing.mode, 'tb')">top</xsl:when>
|
---|
| 27 | <xsl:otherwise>left</xsl:otherwise>
|
---|
| 28 | </xsl:choose>
|
---|
| 29 | </xsl:param>
|
---|
| 30 |
|
---|
| 31 | <xsl:param name="direction.align.end">
|
---|
| 32 | <xsl:choose>
|
---|
| 33 | <xsl:when test="$fop.extensions != 0">right</xsl:when>
|
---|
| 34 | <xsl:when test="$fop1.extensions != 0">right</xsl:when>
|
---|
| 35 | <xsl:when test="starts-with($writing.mode, 'lr')">right</xsl:when>
|
---|
| 36 | <xsl:when test="starts-with($writing.mode, 'rl')">left</xsl:when>
|
---|
| 37 | <xsl:when test="starts-with($writing.mode, 'tb')">bottom</xsl:when>
|
---|
| 38 | <xsl:otherwise>right</xsl:otherwise>
|
---|
| 39 | </xsl:choose>
|
---|
| 40 | </xsl:param>
|
---|
| 41 |
|
---|
| 42 | <xsl:param name="direction.mode">
|
---|
| 43 | <xsl:choose>
|
---|
| 44 | <xsl:when test="$fop.extensions != 0 and
|
---|
| 45 | starts-with($writing.mode, 'rl')">
|
---|
| 46 | <xsl:message>WARNING: FOP does not support right-to-left writing-mode</xsl:message>
|
---|
| 47 | <xsl:text>lr-tb</xsl:text>
|
---|
| 48 | </xsl:when>
|
---|
| 49 | <xsl:when test="$fop1.extensions != 0 and
|
---|
| 50 | starts-with($writing.mode, 'rl')">
|
---|
| 51 | <xsl:message>WARNING: FOP does not support right-to-left writing-mode</xsl:message>
|
---|
| 52 | <xsl:text>lr-tb</xsl:text>
|
---|
| 53 | </xsl:when>
|
---|
| 54 | <xsl:when test="starts-with($writing.mode, 'lr')">lr-tb</xsl:when>
|
---|
| 55 | <xsl:when test="starts-with($writing.mode, 'rl')">rl-tb</xsl:when>
|
---|
| 56 | <xsl:when test="starts-with($writing.mode, 'tb')">tb-rl</xsl:when>
|
---|
| 57 | <xsl:otherwise>lr-tb</xsl:otherwise>
|
---|
| 58 | </xsl:choose>
|
---|
| 59 | </xsl:param>
|
---|
| 60 |
|
---|
| 61 |
|
---|
[c873d807] | 62 | <xsl:template name="anchor">
|
---|
| 63 | <xsl:param name="node" select="."/>
|
---|
| 64 | <xsl:param name="conditional" select="1"/>
|
---|
| 65 | <xsl:variable name="id">
|
---|
| 66 | <xsl:call-template name="object.id">
|
---|
| 67 | <xsl:with-param name="object" select="$node"/>
|
---|
| 68 | </xsl:call-template>
|
---|
| 69 | </xsl:variable>
|
---|
| 70 | <xsl:if test="$conditional = 0 or $node/@id or $node/@xml:id">
|
---|
| 71 | <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
|
---|
| 72 | </xsl:if>
|
---|
| 73 | </xsl:template>
|
---|
| 74 |
|
---|
| 75 | <xsl:template name="dingbat">
|
---|
| 76 | <xsl:param name="dingbat">bullet</xsl:param>
|
---|
| 77 | <xsl:variable name="symbol">
|
---|
| 78 | <xsl:choose>
|
---|
| 79 | <xsl:when test="$dingbat='bullet'">o</xsl:when>
|
---|
| 80 | <xsl:when test="$dingbat='copyright'">©</xsl:when>
|
---|
| 81 | <xsl:when test="$dingbat='trademark'">™</xsl:when>
|
---|
| 82 | <xsl:when test="$dingbat='trade'">™</xsl:when>
|
---|
| 83 | <xsl:when test="$dingbat='registered'">®</xsl:when>
|
---|
| 84 | <xsl:when test="$dingbat='service'">(SM)</xsl:when>
|
---|
| 85 | <xsl:when test="$dingbat='ldquo'">"</xsl:when>
|
---|
| 86 | <xsl:when test="$dingbat='rdquo'">"</xsl:when>
|
---|
| 87 | <xsl:when test="$dingbat='lsquo'">'</xsl:when>
|
---|
| 88 | <xsl:when test="$dingbat='rsquo'">'</xsl:when>
|
---|
| 89 | <xsl:when test="$dingbat='em-dash'">—</xsl:when>
|
---|
| 90 | <xsl:when test="$dingbat='en-dash'">-</xsl:when>
|
---|
| 91 | <xsl:otherwise>o</xsl:otherwise>
|
---|
| 92 | </xsl:choose>
|
---|
| 93 | </xsl:variable>
|
---|
| 94 |
|
---|
| 95 | <xsl:choose>
|
---|
[15c7d39] | 96 | <xsl:when test="$dingbat.fontset = ''">
|
---|
[c873d807] | 97 | <xsl:copy-of select="$symbol"/>
|
---|
| 98 | </xsl:when>
|
---|
| 99 | <xsl:otherwise>
|
---|
[15c7d39] | 100 | <fo:inline font-family="{$dingbat.fontset}">
|
---|
[c873d807] | 101 | <xsl:copy-of select="$symbol"/>
|
---|
| 102 | </fo:inline>
|
---|
| 103 | </xsl:otherwise>
|
---|
| 104 | </xsl:choose>
|
---|
| 105 | </xsl:template>
|
---|
| 106 |
|
---|
| 107 | <xsl:template name="href.target">
|
---|
| 108 | <xsl:param name="context" select="."/>
|
---|
| 109 | <xsl:param name="object" select="."/>
|
---|
| 110 | <xsl:text>#</xsl:text>
|
---|
| 111 | <xsl:call-template name="object.id">
|
---|
| 112 | <xsl:with-param name="object" select="$object"/>
|
---|
| 113 | </xsl:call-template>
|
---|
| 114 | </xsl:template>
|
---|
| 115 |
|
---|
| 116 | </xsl:stylesheet>
|
---|
| 117 |
|
---|