[2] | 1 | <?xml version='1.0'?>
|
---|
| 2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 3 | version='1.0'>
|
---|
| 4 |
|
---|
| 5 | <!-- ********************************************************************
|
---|
| 6 | $Id: html.xsl,v 1.10 2005/06/24 07:20:40 xmldoc Exp $
|
---|
| 7 | ********************************************************************
|
---|
| 8 |
|
---|
| 9 | This file is part of the XSL DocBook Stylesheet distribution.
|
---|
| 10 | See ../README or http://nwalsh.com/docbook/xsl/ for copyright
|
---|
| 11 | and other information.
|
---|
| 12 |
|
---|
| 13 | ******************************************************************** -->
|
---|
| 14 |
|
---|
| 15 | <!-- The generate.html.title template is currently used for generating HTML -->
|
---|
| 16 | <!-- "title" attributes for some inline elements only, but not for any -->
|
---|
| 17 | <!-- block elements. It is called in eleven places in the inline.xsl -->
|
---|
| 18 | <!-- file. But it's called by all the inline.* templates (e.g., -->
|
---|
| 19 | <!-- inline.boldseq), which in turn are called by other (element) -->
|
---|
| 20 | <!-- templates, so it results, currently, in supporting generation of the -->
|
---|
| 21 | <!-- HTML "title" attribute for a total of about 92 elements. -->
|
---|
| 22 | <xsl:template name="generate.html.title">
|
---|
| 23 | <xsl:if test="alt">
|
---|
| 24 | <xsl:attribute name="title">
|
---|
| 25 | <xsl:value-of select="alt"/>
|
---|
| 26 | </xsl:attribute>
|
---|
| 27 | </xsl:if>
|
---|
| 28 | </xsl:template>
|
---|
| 29 |
|
---|
| 30 | <xsl:template name="anchor">
|
---|
| 31 | <xsl:param name="node" select="."/>
|
---|
| 32 | <xsl:param name="conditional" select="1"/>
|
---|
| 33 | <xsl:variable name="id">
|
---|
| 34 | <xsl:call-template name="object.id">
|
---|
| 35 | <xsl:with-param name="object" select="$node"/>
|
---|
| 36 | </xsl:call-template>
|
---|
| 37 | </xsl:variable>
|
---|
| 38 | <xsl:if test="$conditional = 0 or $node/@id or $node/@xml:id">
|
---|
| 39 | <a name="{$id}"/>
|
---|
| 40 | </xsl:if>
|
---|
| 41 | </xsl:template>
|
---|
| 42 |
|
---|
| 43 | <xsl:template name="href.target.uri">
|
---|
| 44 | <xsl:param name="context" select="."/>
|
---|
| 45 | <xsl:param name="object" select="."/>
|
---|
| 46 | <xsl:text>#</xsl:text>
|
---|
| 47 | <xsl:call-template name="object.id">
|
---|
| 48 | <xsl:with-param name="object" select="$object"/>
|
---|
| 49 | </xsl:call-template>
|
---|
| 50 | </xsl:template>
|
---|
| 51 |
|
---|
| 52 | <xsl:template name="href.target">
|
---|
| 53 | <xsl:param name="context" select="."/>
|
---|
| 54 | <xsl:param name="object" select="."/>
|
---|
| 55 | <xsl:text>#</xsl:text>
|
---|
| 56 | <xsl:call-template name="object.id">
|
---|
| 57 | <xsl:with-param name="object" select="$object"/>
|
---|
| 58 | </xsl:call-template>
|
---|
| 59 | </xsl:template>
|
---|
| 60 |
|
---|
| 61 | <xsl:template name="href.target.with.base.dir">
|
---|
| 62 | <xsl:param name="object" select="."/>
|
---|
| 63 | <xsl:if test="$manifest.in.base.dir = 0">
|
---|
| 64 | <xsl:value-of select="$base.dir"/>
|
---|
| 65 | </xsl:if>
|
---|
| 66 | <xsl:call-template name="href.target">
|
---|
| 67 | <xsl:with-param name="object" select="$object"/>
|
---|
| 68 | </xsl:call-template>
|
---|
| 69 | </xsl:template>
|
---|
| 70 |
|
---|
| 71 | <xsl:template name="dingbat">
|
---|
| 72 | <xsl:param name="dingbat">bullet</xsl:param>
|
---|
| 73 | <xsl:call-template name="dingbat.characters">
|
---|
| 74 | <xsl:with-param name="dingbat" select="$dingbat"/>
|
---|
| 75 | </xsl:call-template>
|
---|
| 76 | </xsl:template>
|
---|
| 77 |
|
---|
| 78 | <xsl:template name="dingbat.characters">
|
---|
| 79 | <!-- now that I'm using the real serializer, all that dingbat malarky -->
|
---|
| 80 | <!-- isn't necessary anymore... -->
|
---|
| 81 | <xsl:param name="dingbat">bullet</xsl:param>
|
---|
| 82 | <xsl:choose>
|
---|
| 83 | <xsl:when test="$dingbat='bullet'">•</xsl:when>
|
---|
| 84 | <xsl:when test="$dingbat='copyright'">©</xsl:when>
|
---|
| 85 | <xsl:when test="$dingbat='trademark'">™</xsl:when>
|
---|
| 86 | <xsl:when test="$dingbat='trade'">™</xsl:when>
|
---|
| 87 | <xsl:when test="$dingbat='registered'">®</xsl:when>
|
---|
| 88 | <xsl:when test="$dingbat='service'">(SM)</xsl:when>
|
---|
| 89 | <xsl:when test="$dingbat='nbsp'"> </xsl:when>
|
---|
| 90 | <xsl:when test="$dingbat='ldquo'">“</xsl:when>
|
---|
| 91 | <xsl:when test="$dingbat='rdquo'">”</xsl:when>
|
---|
| 92 | <xsl:when test="$dingbat='lsquo'">‘</xsl:when>
|
---|
| 93 | <xsl:when test="$dingbat='rsquo'">’</xsl:when>
|
---|
| 94 | <xsl:when test="$dingbat='em-dash'">—</xsl:when>
|
---|
| 95 | <xsl:when test="$dingbat='mdash'">—</xsl:when>
|
---|
| 96 | <xsl:when test="$dingbat='en-dash'">–</xsl:when>
|
---|
| 97 | <xsl:when test="$dingbat='ndash'">–</xsl:when>
|
---|
| 98 | <xsl:otherwise>
|
---|
| 99 | <xsl:text>•</xsl:text>
|
---|
| 100 | </xsl:otherwise>
|
---|
| 101 | </xsl:choose>
|
---|
| 102 | </xsl:template>
|
---|
| 103 |
|
---|
| 104 | </xsl:stylesheet>
|
---|
| 105 |
|
---|