|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/22697/root/usr/share/yelp/xslt/ |
Upload File : |
<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:yelp="http://www.gnome.org/yelp/ns"
xmlns="http://www.w3.org/1999/xhtml"
extension-element-prefixes="yelp"
version="1.0">
<xsl:param name="help_icon"/>
<xsl:param name="help_icon_size"/>
<xsl:param name="yelp.color.fg"/>
<xsl:param name="yelp.color.bg"/>
<xsl:param name="yelp.color.anchor"/>
<xsl:param name="yelp.color.rule"/>
<xsl:param name="yelp.color.gray.fg"/>
<xsl:param name="yelp.color.gray.bg"/>
<xsl:param name="yelp.color.gray.bg.dark1"/>
<xsl:param name="yelp.color.gray.bg.dark2"/>
<xsl:param name="yelp.color.gray.bg.dark3"/>
<xsl:param name="yelp.color.selected.fg"/>
<xsl:param name="yelp.color.selected.bg"/>
<xsl:param name="yelp.color.selected.bg.dark1"/>
<xsl:param name="yelp.color.selected.bg.dark2"/>
<xsl:param name="yelp.color.selected.bg.dark3"/>
<xsl:param name="yelp.color.admon.fg"/>
<xsl:param name="yelp.color.admon.bg"/>
<xsl:param name="yelp.color.admon.bg.dark1"/>
<xsl:param name="yelp.color.admon.bg.dark2"/>
<xsl:param name="yelp.color.admon.bg.dark3"/>
<xsl:param name="yelp.toc.id" select="'Man-man6'"/>
<xsl:template match="toc">
<yelp:document href="{@id}">
<html>
<head>
<title>
<xsl:value-of select="title[1]"/>
</title>
<style type="text/css"><xsl:text>
body {
margin: 0px;
padding: 0px;
}
h1 {
font-size: 1.6em;
margin-bottom: 0.4em;
margin-top: 12px;
margin-left: 12px;
margin-right: 12px;
padding-left: 204px;
padding-top: 0.2em;
padding-bottom: 0.2em;
-moz-border-radius: 6px;
border: solid 1px </xsl:text>
<xsl:value-of select="$yelp.color.selected.bg.dark1"/><xsl:text>;
background-color: </xsl:text>
<xsl:value-of select="$yelp.color.selected.bg"/><xsl:text>;
color: </xsl:text>
<xsl:value-of select="$yelp.color.selected.fg"/><xsl:text>;
}
h1 img {
position: absolute;
top: 6px;
right: 18px;
}
h2 h3 {
color: </xsl:text><xsl:value-of select="$yelp.color.fg"/><xsl:text>;
}
div[class~="body"] { }
div[class~="leftbar"] {
position: absolute;
top: 4em;
left: 12px;
width: 192px;
min-height: 192px;
text-align: left;
/* padding-top: </xsl:text>
<xsl:value-of select="$help_icon_size"/><xsl:text>px;
background-image: url("</xsl:text>
<xsl:value-of select="$help_icon"/><xsl:text>");
background-position: </xsl:text>
<xsl:value-of select="(192 - $help_icon_size) div 2"/><xsl:text>px 0px;
background-repeat: no-repeat;
opacity: .3; */
}
div[class~="leftbackground"] {
position: absolute;
top: 4em;
left: 1px;
width: 210px;
min-height: 192px;
text-align: center;
padding-top: 0px;
background-image:url("</xsl:text>
<xsl:value-of select="$help_icon"/><xsl:text>");
background-position: </xsl:text>
<xsl:value-of select="(192 - $help_icon_size) div 2"/><xsl:text>px 0px;
background-repeat: no-repeat;
opacity: .1;
}
div[class~="rightbar"] {
margin-left: 216px;
padding-bottom: 1em;
padding-top: 1em;
padding-left: 1em;
padding-right: 1em;
margin-right: 12px;
background-color: </xsl:text><xsl:value-of select="$yelp.color.bg"/><xsl:text>;
color: </xsl:text><xsl:value-of select="$yelp.color.fg"/><xsl:text>;
-moz-border-radius: 8px;
}
ul { margin-left: 0em; padding-left: 0em; }
li[class~="toclist"] {
margin-top: 0.3em;
margin-left: 0em;
padding-left: 0em;
font-size: 1.2em;
list-style-type: none;
}
li li[class~="toclist"] {
padding-left: 0.8em;
font-size: 0.8em;
}
li li li[class~="toclist"] {
padding-left: 0.8em;
font-size: 0.6em;
}
li[class~="toc"] {
margin-left: 0em;
font-size: 1.2em;
padding-top: 0.5em;
list-style-type: none;
}
dl { margin-left: 0em; padding-left: 0em; }
dt { font-size: 1.2em; margin-top: 1em; }
dd { margin-left: 1em; margin-top: 0.5em; }
a { text-decoration: none; color: </xsl:text><xsl:value-of select="$yelp.color.anchor"/><xsl:text>; }
a:hover { text-decoration: underline; }
</xsl:text></style>
</head>
<body>
<xsl:apply-templates mode="body.mode" select="."/>
</body>
</html>
</yelp:document>
</xsl:template>
<xsl:template name="print.documents">
<div class="docs">
<dl>
<xsl:for-each select="doc">
<xsl:sort select="normalize-space(title)"/>
<dt class="doc">
<a href="{@href}" title="{@href}">
<xsl:if test="tooltip">
<xsl:attribute name="title">
<xsl:value-of select="tooltip"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="title"/>
</a>
</dt>
<dd>
<xsl:value-of select="description"/>
</dd>
</xsl:for-each>
</dl>
</div>
</xsl:template>
<xsl:template name="print.subsections">
<div class="tocs">
<ul>
<xsl:for-each select="toc[../@id = 'index' or .//doc]">
<xsl:sort select="number(../@id = 'index') * position()"/>
<xsl:sort select="normalize-space(title)"/>
<li class="toc">
<a href="x-yelp-toc:{@id}">
<xsl:apply-templates select="title[1]/node()"/>
</a>
</li>
</xsl:for-each>
</ul>
</div>
</xsl:template>
<xsl:template mode="body.mode" match="toc">
<div class="leftbackground">
</div>
<div class="body">
<h1>
<xsl:if test="icon">
<img src="{icon/@file}"/>
</xsl:if>
<xsl:apply-templates select="title"/>
</h1>
<div class="leftbar">
<xsl:choose>
<xsl:when test="@id= 'index'">
<h2><xsl:value-of select="/toc/title"/></h2>
</xsl:when>
<xsl:otherwise>
<a href="x-yelp-toc:index"><h2><xsl:value-of select="/toc/title"/>
</h2></a>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates mode="leftbar.mode" select="/toc">
<xsl:with-param name="curid" select="@id"/>
</xsl:apply-templates>
</div>
<div class="rightbar">
<h3><xsl:apply-templates select="description/node()"/></h3>
<xsl:choose>
<!-- if there are documents and subsections, only print documents -->
<xsl:when test="doc[1] and toc[.//doc[1]]">
<xsl:call-template name="print.documents"/>
</xsl:when>
<!-- if there are documents, print them -->
<xsl:when test="doc[1]">
<xsl:call-template name="print.documents"/>
</xsl:when>
<!-- if there are subsections, print them -->
<xsl:when test="toc[.//doc[1]]">
<xsl:call-template name="print.subsections"/>
</xsl:when>
<xsl:otherwise>
<h3>No documents or subcategories found.</h3>
</xsl:otherwise>
</xsl:choose>
</div>
</div>
</xsl:template>
<!-- tricky recursive xslt -->
<xsl:template mode="leftbar.mode" match="toc">
<xsl:param name="curid" select="0"/>
<ul>
<xsl:for-each select="toc[.//doc[1]]">
<li class="toclist">
<xsl:choose>
<xsl:when test="@id != $curid">
<a href="x-yelp-toc:{@id}">
<xsl:value-of select="title[1]/node()"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="title[1]/node()"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="@id = $curid or .//toc[@id = $curid]">
<xsl:apply-templates mode="leftbar.mode" select=".">
<xsl:with-param name="curid" select="$curid"/>
</xsl:apply-templates>
</xsl:if>
</li>
</xsl:for-each>
</ul>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates select="//toc[@id = $yelp.toc.id]" />
</xsl:template>
</xsl:stylesheet>