[5d4975d] | 1 | <?xml version='1.0' encoding='ISO-8859-1'?>
|
---|
| 2 |
|
---|
| 3 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 4 | xmlns="http://www.w3.org/1999/xhtml"
|
---|
| 5 | version="1.0">
|
---|
| 6 |
|
---|
[3fe8b511] | 7 | <!-- screen -->
|
---|
[5d4975d] | 8 | <xsl:template match="screen">
|
---|
| 9 | <xsl:choose>
|
---|
[3fe8b511] | 10 | <xsl:when test="child::* = userinput">
|
---|
| 11 | <pre class="userinput">
|
---|
| 12 | <xsl:apply-templates/>
|
---|
[5d4975d] | 13 | </pre>
|
---|
| 14 | </xsl:when>
|
---|
| 15 | <xsl:otherwise>
|
---|
| 16 | <pre class="{name(.)}">
|
---|
| 17 | <xsl:apply-templates/>
|
---|
| 18 | </pre>
|
---|
| 19 | </xsl:otherwise>
|
---|
| 20 | </xsl:choose>
|
---|
| 21 | </xsl:template>
|
---|
[3fe8b511] | 22 |
|
---|
| 23 | <!-- userinput -->
|
---|
| 24 | <xsl:template match="userinput">
|
---|
| 25 | <xsl:choose>
|
---|
| 26 | <xsl:when test="ancestor::screen">
|
---|
| 27 | <kbd class="command">
|
---|
| 28 | <xsl:apply-templates/>
|
---|
| 29 | </kbd>
|
---|
| 30 | </xsl:when>
|
---|
| 31 | <xsl:otherwise>
|
---|
| 32 | <xsl:apply-imports/>
|
---|
| 33 | </xsl:otherwise>
|
---|
| 34 | </xsl:choose>
|
---|
| 35 | </xsl:template>
|
---|
| 36 |
|
---|
| 37 | <!-- Body attributes -->
|
---|
| 38 | <xsl:template name="body.attributes">
|
---|
| 39 | <xsl:attribute name="id">
|
---|
| 40 | <xsl:text>blfs</xsl:text>
|
---|
| 41 | </xsl:attribute>
|
---|
| 42 | <xsl:attribute name="class">
|
---|
| 43 | <xsl:value-of select="substring-after(/book/bookinfo/subtitle, ' ')"/>
|
---|
| 44 | </xsl:attribute>
|
---|
| 45 | </xsl:template>
|
---|
| 46 |
|
---|
[6279d44] | 47 | <!-- External URLs in class='url' -->
|
---|
[3fe8b511] | 48 | <xsl:template match="ulink" name="ulink">
|
---|
| 49 | <a>
|
---|
| 50 | <xsl:if test="@id">
|
---|
| 51 | <xsl:attribute name="id">
|
---|
| 52 | <xsl:value-of select="@id"/>
|
---|
| 53 | </xsl:attribute>
|
---|
| 54 | </xsl:if>
|
---|
| 55 | <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
|
---|
[6279d44] | 56 | <span class='url'>
|
---|
[3fe8b511] | 57 | <xsl:choose>
|
---|
| 58 | <xsl:when test="count(child::node())=0">
|
---|
| 59 | <xsl:value-of select="@url"/>
|
---|
| 60 | </xsl:when>
|
---|
| 61 | <xsl:otherwise>
|
---|
| 62 | <xsl:apply-templates/>
|
---|
| 63 | </xsl:otherwise>
|
---|
| 64 | </xsl:choose>
|
---|
[6279d44] | 65 | </span>
|
---|
[3fe8b511] | 66 | </a>
|
---|
| 67 | </xsl:template>
|
---|
| 68 |
|
---|
[ad825f2] | 69 | <!-- Cunstomizing segementedlist -->
|
---|
| 70 | <xsl:template match="seg">
|
---|
| 71 | <xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
|
---|
| 72 | <xsl:variable name="seglist" select="ancestor::segmentedlist"/>
|
---|
| 73 | <xsl:variable name="segtitles" select="$seglist/segtitle"/>
|
---|
| 74 | <!-- Note: segtitle is only going to be the right thing in a well formed
|
---|
| 75 | SegmentedList. If there are too many Segs or too few SegTitles,
|
---|
| 76 | you'll get something odd...maybe an error -->
|
---|
| 77 | <div class="seg">
|
---|
| 78 | <strong>
|
---|
| 79 | <span class="segtitle">
|
---|
| 80 | <xsl:apply-templates select="$segtitles[$segnum=position()]"
|
---|
| 81 | mode="segtitle-in-seg"/>
|
---|
| 82 | <xsl:text>: </xsl:text>
|
---|
| 83 | </span>
|
---|
| 84 | </strong>
|
---|
| 85 | <span class="seg">
|
---|
| 86 | <xsl:apply-templates/>
|
---|
| 87 | </span>
|
---|
| 88 | </div>
|
---|
| 89 | </xsl:template>
|
---|
| 90 |
|
---|
[3fe8b511] | 91 | <!-- The <code> xhtml tag have look issues in some browsers, like Konqueror and.
|
---|
| 92 | isn't semantically correct (a filename isn't a code fragment) We will use <tt> for now. -->
|
---|
| 93 | <xsl:template name="inline.monoseq">
|
---|
| 94 | <xsl:param name="content">
|
---|
| 95 | <xsl:call-template name="anchor"/>
|
---|
| 96 | <xsl:call-template name="simple.xlink">
|
---|
| 97 | <xsl:with-param name="content">
|
---|
| 98 | <xsl:apply-templates/>
|
---|
| 99 | </xsl:with-param>
|
---|
| 100 | </xsl:call-template>
|
---|
| 101 | </xsl:param>
|
---|
| 102 | <tt class="{local-name(.)}">
|
---|
| 103 | <xsl:if test="@dir">
|
---|
| 104 | <xsl:attribute name="dir">
|
---|
| 105 | <xsl:value-of select="@dir"/>
|
---|
| 106 | </xsl:attribute>
|
---|
| 107 | </xsl:if>
|
---|
| 108 | <xsl:copy-of select="$content"/>
|
---|
| 109 | </tt>
|
---|
| 110 | </xsl:template>
|
---|
| 111 |
|
---|
| 112 | <xsl:template name="inline.boldmonoseq">
|
---|
| 113 | <xsl:param name="content">
|
---|
| 114 | <xsl:call-template name="anchor"/>
|
---|
| 115 | <xsl:call-template name="simple.xlink">
|
---|
| 116 | <xsl:with-param name="content">
|
---|
| 117 | <xsl:apply-templates/>
|
---|
| 118 | </xsl:with-param>
|
---|
| 119 | </xsl:call-template>
|
---|
| 120 | </xsl:param>
|
---|
| 121 | <!-- don't put <strong> inside figure, example, or table titles -->
|
---|
| 122 | <!-- or other titles that may already be represented with <strong>'s. -->
|
---|
| 123 | <xsl:choose>
|
---|
| 124 | <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure'
|
---|
| 125 | or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
|
---|
| 126 | <tt class="{local-name(.)}">
|
---|
| 127 | <xsl:if test="@dir">
|
---|
| 128 | <xsl:attribute name="dir">
|
---|
| 129 | <xsl:value-of select="@dir"/>
|
---|
| 130 | </xsl:attribute>
|
---|
| 131 | </xsl:if>
|
---|
| 132 | <xsl:copy-of select="$content"/>
|
---|
| 133 | </tt>
|
---|
| 134 | </xsl:when>
|
---|
| 135 | <xsl:otherwise>
|
---|
| 136 | <strong class="{local-name(.)}">
|
---|
| 137 | <tt>
|
---|
| 138 | <xsl:if test="@dir">
|
---|
| 139 | <xsl:attribute name="dir">
|
---|
| 140 | <xsl:value-of select="@dir"/>
|
---|
| 141 | </xsl:attribute>
|
---|
| 142 | </xsl:if>
|
---|
| 143 | <xsl:copy-of select="$content"/>
|
---|
| 144 | </tt>
|
---|
| 145 | </strong>
|
---|
| 146 | </xsl:otherwise>
|
---|
| 147 | </xsl:choose>
|
---|
| 148 | </xsl:template>
|
---|
| 149 |
|
---|
| 150 | <xsl:template name="inline.italicmonoseq">
|
---|
| 151 | <xsl:param name="content">
|
---|
| 152 | <xsl:call-template name="anchor"/>
|
---|
| 153 | <xsl:call-template name="simple.xlink">
|
---|
| 154 | <xsl:with-param name="content">
|
---|
| 155 | <xsl:apply-templates/>
|
---|
| 156 | </xsl:with-param>
|
---|
| 157 | </xsl:call-template>
|
---|
| 158 | </xsl:param>
|
---|
| 159 | <em class="{local-name(.)}">
|
---|
| 160 | <tt>
|
---|
| 161 | <xsl:if test="@dir">
|
---|
| 162 | <xsl:attribute name="dir">
|
---|
| 163 | <xsl:value-of select="@dir"/>
|
---|
| 164 | </xsl:attribute>
|
---|
| 165 | </xsl:if>
|
---|
| 166 | <xsl:copy-of select="$content"/>
|
---|
| 167 | </tt>
|
---|
| 168 | </em>
|
---|
| 169 | </xsl:template>
|
---|
[5d4975d] | 170 |
|
---|
| 171 | </xsl:stylesheet>
|
---|