| [12] | 1 | <?xml version="1.0"?> |
|---|
| 2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|---|
| 3 | version="1.0"> |
|---|
| 4 | |
|---|
| 5 | <!-- Import the HTML chunking stylesheet --> |
|---|
| 6 | <xsl:import |
|---|
| 7 | href="http://docbook.sourceforge.net/release/xsl/current/html/chunk-common.xsl"/> |
|---|
| 8 | |
|---|
| 9 | <xsl:import href="relative-href.xsl"/> |
|---|
| 10 | |
|---|
| 11 | <!-- ==================================================================== --> |
|---|
| 12 | |
|---|
| 13 | <xsl:template match="*" mode="recursive-chunk-filename"> |
|---|
| 14 | <xsl:param name="recursive" select="false()"/> |
|---|
| 15 | |
|---|
| 16 | <xsl:variable name="their"> |
|---|
| 17 | <xsl:apply-imports mode="recursive-chunk-filename" select="."/> |
|---|
| 18 | </xsl:variable> |
|---|
| 19 | |
|---|
| 20 | <xsl:variable name="basename" select="substring-before( $their, $html.ext )"/> |
|---|
| 21 | <xsl:choose> |
|---|
| 22 | <xsl:when test="not($recursive)"> |
|---|
| 23 | <xsl:value-of select="translate( $basename, '.', '/' )"/> |
|---|
| 24 | <xsl:value-of select="$html.ext"/> |
|---|
| 25 | </xsl:when> |
|---|
| 26 | <xsl:otherwise> |
|---|
| 27 | <xsl:value-of select="$basename"/> |
|---|
| 28 | <xsl:value-of select="'.'"/> |
|---|
| 29 | </xsl:otherwise> |
|---|
| 30 | </xsl:choose> |
|---|
| 31 | |
|---|
| 32 | </xsl:template> |
|---|
| 33 | |
|---|
| 34 | <!-- ==================================================================== --> |
|---|
| 35 | |
|---|
| 36 | <xsl:template name="navig.content"> |
|---|
| 37 | <xsl:param name="direction" select="next"/> |
|---|
| 38 | <xsl:variable name="navtext"> |
|---|
| 39 | <xsl:choose> |
|---|
| 40 | <xsl:when test="$direction = 'prev'"> |
|---|
| 41 | <xsl:call-template name="gentext.nav.prev"/> |
|---|
| 42 | </xsl:when> |
|---|
| 43 | <xsl:when test="$direction = 'next'"> |
|---|
| 44 | <xsl:call-template name="gentext.nav.next"/> |
|---|
| 45 | </xsl:when> |
|---|
| 46 | <xsl:when test="$direction = 'up'"> |
|---|
| 47 | <xsl:call-template name="gentext.nav.up"/> |
|---|
| 48 | </xsl:when> |
|---|
| 49 | <xsl:when test="$direction = 'home'"> |
|---|
| 50 | <xsl:call-template name="gentext.nav.home"/> |
|---|
| 51 | </xsl:when> |
|---|
| 52 | <xsl:otherwise> |
|---|
| 53 | <xsl:text>xxx</xsl:text> |
|---|
| 54 | </xsl:otherwise> |
|---|
| 55 | </xsl:choose> |
|---|
| 56 | </xsl:variable> |
|---|
| 57 | |
|---|
| 58 | <xsl:choose> |
|---|
| 59 | <xsl:when test="$navig.graphics != 0"> |
|---|
| 60 | <img> |
|---|
| 61 | <xsl:attribute name="src"> |
|---|
| 62 | <xsl:call-template name="href.target.relative"> |
|---|
| 63 | <xsl:with-param name="target" select="$navig.graphics.path"/> |
|---|
| 64 | </xsl:call-template> |
|---|
| 65 | <xsl:value-of select="$direction"/> |
|---|
| 66 | <xsl:value-of select="$navig.graphics.extension"/> |
|---|
| 67 | </xsl:attribute> |
|---|
| 68 | <xsl:attribute name="alt"> |
|---|
| 69 | <xsl:value-of select="$navtext"/> |
|---|
| 70 | </xsl:attribute> |
|---|
| 71 | </img> |
|---|
| 72 | </xsl:when> |
|---|
| 73 | <xsl:otherwise> |
|---|
| 74 | <xsl:value-of select="$navtext"/> |
|---|
| 75 | </xsl:otherwise> |
|---|
| 76 | </xsl:choose> |
|---|
| 77 | </xsl:template> |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | <!-- ====================================================================== --> |
|---|
| 81 | |
|---|
| 82 | <xsl:template match="@fileref"> |
|---|
| 83 | <xsl:choose> |
|---|
| 84 | <xsl:when test="contains(., ':')"> |
|---|
| 85 | <xsl:value-of select="."/> |
|---|
| 86 | </xsl:when> |
|---|
| 87 | <xsl:otherwise> |
|---|
| 88 | <xsl:call-template name="href.target.relative"> |
|---|
| 89 | <xsl:with-param name="target" select="."/> |
|---|
| 90 | <xsl:with-param name="context" select=".."/> |
|---|
| 91 | </xsl:call-template> |
|---|
| 92 | </xsl:otherwise> |
|---|
| 93 | </xsl:choose> |
|---|
| 94 | </xsl:template> |
|---|
| 95 | |
|---|
| 96 | |
|---|
| 97 | <xsl:template match="@url"> |
|---|
| 98 | <xsl:choose> |
|---|
| 99 | <xsl:when test="contains(., ':')"> |
|---|
| 100 | <xsl:value-of select="."/> |
|---|
| 101 | </xsl:when> |
|---|
| 102 | <xsl:otherwise> |
|---|
| 103 | <xsl:text>XXX</xsl:text> |
|---|
| 104 | <xsl:value-of select="."/> |
|---|
| 105 | <xsl:text>XXX</xsl:text> |
|---|
| 106 | </xsl:otherwise> |
|---|
| 107 | </xsl:choose> |
|---|
| 108 | </xsl:template> |
|---|
| 109 | |
|---|
| 110 | |
|---|
| 111 | </xsl:stylesheet> |
|---|