aboutsummaryrefslogtreecommitdiffstats
path: root/stylesheets/xhtml/lfs-mixed.xsl
diff options
context:
space:
mode:
Diffstat (limited to 'stylesheets/xhtml/lfs-mixed.xsl')
-rw-r--r--stylesheets/xhtml/lfs-mixed.xsl264
1 files changed, 0 insertions, 264 deletions
diff --git a/stylesheets/xhtml/lfs-mixed.xsl b/stylesheets/xhtml/lfs-mixed.xsl
deleted file mode 100644
index 28460256b..000000000
--- a/stylesheets/xhtml/lfs-mixed.xsl
+++ /dev/null
@@ -1,264 +0,0 @@
-<?xml version='1.0' encoding='ISO-8859-1'?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns="http://www.w3.org/1999/xhtml"
- version="1.0">
-
- <!-- para -->
- <xsl:template match="para">
- <xsl:choose>
- <xsl:when test="child::ulink[@url=' ']"/>
- <xsl:otherwise>
- <xsl:call-template name="paragraph">
- <xsl:with-param name="class">
- <xsl:if test="@role and $para.propagates.style != 0">
- <xsl:value-of select="@role"/>
- </xsl:if>
- </xsl:with-param>
- <xsl:with-param name="content">
- <xsl:if test="position() = 1 and parent::listitem">
- <xsl:call-template name="anchor">
- <xsl:with-param name="node" select="parent::listitem"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:call-template name="anchor"/>
- <xsl:apply-templates/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- screen -->
- <xsl:template match="screen">
- <xsl:choose>
- <xsl:when test="child::* = userinput">
- <pre class="userinput">
- <xsl:apply-templates/>
- </pre>
- </xsl:when>
- <xsl:otherwise>
- <pre class="{name(.)}">
- <xsl:apply-templates/>
- </pre>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="userinput">
- <xsl:choose>
- <xsl:when test="ancestor::screen">
- <kbd class="command">
- <xsl:apply-templates/>
- </kbd>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-imports/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- segementedlist -->
- <xsl:template match="seg">
- <xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
- <xsl:variable name="seglist" select="ancestor::segmentedlist"/>
- <xsl:variable name="segtitles" select="$seglist/segtitle"/>
- <!-- Note: segtitle is only going to be the right thing in a well formed
- SegmentedList. If there are too many Segs or too few SegTitles,
- you'll get something odd...maybe an error -->
- <div class="seg">
- <strong>
- <span class="segtitle">
- <xsl:apply-templates select="$segtitles[$segnum=position()]" mode="segtitle-in-seg"/>
- <xsl:text>: </xsl:text>
- </span>
- </strong>
- <span class="seg">
- <xsl:apply-templates/>
- </span>
- </div>
- </xsl:template>
-
-
- <!-- variablelist -->
- <xsl:template match="variablelist">
- <xsl:choose>
- <xsl:when test="@role">
- <div class="{@role}">
- <xsl:apply-imports/>
- </div>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-imports/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <!-- Body attributes -->
- <xsl:template name="body.attributes">
- <xsl:attribute name="id">
- <xsl:text>lfs</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="class">
- <xsl:value-of select="substring-after(/book/bookinfo/subtitle, ' ')"/>
- </xsl:attribute>
- </xsl:template>
-
- <!-- External URLs in italic font -->
- <xsl:template match="ulink" name="ulink">
- <a>
- <xsl:if test="@id">
- <xsl:attribute name="id">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
- <i>
- <xsl:choose>
- <xsl:when test="count(child::node())=0">
- <xsl:value-of select="@url"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates/>
- </xsl:otherwise>
- </xsl:choose>
- </i>
- </a>
- </xsl:template>
-
- <!-- The <code> xhtml tag have look issues in some browsers, like Konqueror and.
- isn't semantically correct (a filename isn't a code fragment) We will use <tt> for now. -->
- <xsl:template name="inline.monoseq">
- <xsl:param name="content">
- <xsl:call-template name="anchor"/>
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:apply-templates/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:param>
- <tt class="{local-name(.)}">
- <xsl:if test="@dir">
- <xsl:attribute name="dir">
- <xsl:value-of select="@dir"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:copy-of select="$content"/>
- </tt>
- </xsl:template>
-
- <xsl:template name="inline.boldmonoseq">
- <xsl:param name="content">
- <xsl:call-template name="anchor"/>
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:apply-templates/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:param>
- <!-- don't put <strong> inside figure, example, or table titles -->
- <!-- or other titles that may already be represented with <strong>'s. -->
- <xsl:choose>
- <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure'
- or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
- <tt class="{local-name(.)}">
- <xsl:if test="@dir">
- <xsl:attribute name="dir">
- <xsl:value-of select="@dir"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:copy-of select="$content"/>
- </tt>
- </xsl:when>
- <xsl:otherwise>
- <strong class="{local-name(.)}">
- <tt>
- <xsl:if test="@dir">
- <xsl:attribute name="dir">
- <xsl:value-of select="@dir"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:copy-of select="$content"/>
- </tt>
- </strong>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="inline.italicmonoseq">
- <xsl:param name="content">
- <xsl:call-template name="anchor"/>
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:apply-templates/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:param>
- <em class="{local-name(.)}">
- <tt>
- <xsl:if test="@dir">
- <xsl:attribute name="dir">
- <xsl:value-of select="@dir"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:copy-of select="$content"/>
- </tt>
- </em>
- </xsl:template>
-
- <!-- Total packages size calculation -->
- <xsl:template match="returnvalue">
- <xsl:call-template name="calculation">
- <xsl:with-param name="scope" select="../../variablelist"/>
- </xsl:call-template>
- </xsl:template>
-
- <xsl:template name="calculation">
- <xsl:param name="scope"/>
- <xsl:param name="total">0</xsl:param>
- <xsl:param name="position">1</xsl:param>
- <xsl:variable name="tokens" select="count($scope/varlistentry)"/>
- <xsl:variable name="token" select="$scope/varlistentry[$position]/term/token"/>
- <xsl:variable name="size" select="substring-before($token,' KB')"/>
- <xsl:variable name="rawsize">
- <xsl:choose>
- <xsl:when test="contains($size,',')">
- <xsl:value-of select="concat(substring-before($size,','),substring-after($size,','))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$size"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$position &lt;= $tokens">
- <xsl:call-template name="calculation">
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="position" select="$position +1"/>
- <xsl:with-param name="total" select="$total + $rawsize"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$total &lt; '1000'">
- <xsl:value-of select="$total"/>
- <xsl:text> KB</xsl:text>
- </xsl:when>
- <xsl:when test="$total &gt; '1000' and $total &lt; '5000'">
- <xsl:value-of select="substring($total,1,1)"/>
- <xsl:text>,</xsl:text>
- <xsl:value-of select="substring($total,2)"/>
- <xsl:text> KB</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="round($total div 1024)"/>
- <xsl:text> MB</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-</xsl:stylesheet>