| 1 |
<?xml version='1.0'?> |
| 2 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 3 |
xmlns:html='http://www.w3.org/1999/xhtml' |
| 4 |
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" |
| 5 |
exclude-result-prefixes="doc html" |
| 6 |
version='1.0'> |
| 7 |
|
| 8 |
<!-- ******************************************************************** |
| 9 |
|
| 10 |
This file is part of the WebSite distribution. |
| 11 |
See ../README or http://nwalsh.com/website/ for copyright |
| 12 |
copyright and other information. |
| 13 |
|
| 14 |
******************************************************************** --> |
| 15 |
|
| 16 |
<!-- ==================================================================== --> |
| 17 |
|
| 18 |
<xsl:include href="website-common.xsl"/> |
| 19 |
<xsl:include href="toc.xsl"/> |
| 20 |
|
| 21 |
<xsl:output method="html" |
| 22 |
indent="no"/> |
| 23 |
|
| 24 |
<xsl:param name="autolayout" select="document($autolayout-file,/*[1])"/> |
| 25 |
|
| 26 |
<xsl:attribute-set name="body.attributes"/> |
| 27 |
|
| 28 |
<xsl:template name="body.attributes"> |
| 29 |
<!-- Turn off the template from the stock DocBook XSL --> |
| 30 |
</xsl:template> |
| 31 |
|
| 32 |
<!-- ==================================================================== --> |
| 33 |
|
| 34 |
<xsl:template match="webpage"> |
| 35 |
<xsl:variable name="id"> |
| 36 |
<xsl:call-template name="object.id"/> |
| 37 |
</xsl:variable> |
| 38 |
|
| 39 |
<xsl:variable name="tocentry" select="$autolayout/autolayout//*[$id=@id]"/> |
| 40 |
<xsl:variable name="toc" select="$tocentry/ancestor-or-self::toc"/> |
| 41 |
|
| 42 |
<html> |
| 43 |
<xsl:apply-templates select="head" mode="head.mode"/> |
| 44 |
<xsl:apply-templates select="config" mode="head.mode"/> |
| 45 |
<body class="website"> |
| 46 |
<xsl:call-template name="body.attributes"/> |
| 47 |
|
| 48 |
<div class="{name(.)}"> |
| 49 |
<a name="{$id}"/> |
| 50 |
|
| 51 |
<xsl:if test="$banner.before.navigation != 0"> |
| 52 |
<xsl:call-template name="allpages.banner"/> |
| 53 |
</xsl:if> |
| 54 |
|
| 55 |
<xsl:if test="$toc"> |
| 56 |
<div class="navhead"> |
| 57 |
<xsl:apply-templates select="$toc"> |
| 58 |
<xsl:with-param name="pageid" select="@id"/> |
| 59 |
</xsl:apply-templates> |
| 60 |
<xsl:if test="$header.hr != 0"><hr/></xsl:if> |
| 61 |
</div> |
| 62 |
</xsl:if> |
| 63 |
|
| 64 |
<xsl:if test="$banner.before.navigation = 0"> |
| 65 |
<xsl:call-template name="allpages.banner"/> |
| 66 |
</xsl:if> |
| 67 |
|
| 68 |
<xsl:apply-templates select="./head/title" mode="title.mode"/> |
| 69 |
|
| 70 |
<xsl:apply-templates select="child::node()[not(self::webpage)]"/> |
| 71 |
|
| 72 |
<xsl:call-template name="process.footnotes"/> |
| 73 |
|
| 74 |
<xsl:call-template name="webpage.footer"/> |
| 75 |
</div> |
| 76 |
</body> |
| 77 |
</html> |
| 78 |
</xsl:template> |
| 79 |
|
| 80 |
<!-- ==================================================================== --> |
| 81 |
|
| 82 |
<xsl:template match="webtoc"> |
| 83 |
<xsl:variable name="webpage" select="ancestor::webpage"/> |
| 84 |
<xsl:variable name="relpath"> |
| 85 |
<xsl:call-template name="root-rel-path"> |
| 86 |
<xsl:with-param name="webpage" select="$webpage"/> |
| 87 |
</xsl:call-template> |
| 88 |
</xsl:variable> |
| 89 |
<xsl:variable name="pageid" select="$webpage/@id"/> |
| 90 |
|
| 91 |
<xsl:variable name="pages" |
| 92 |
select="$autolayout//*[$pageid=@id]/tocentry"/> |
| 93 |
|
| 94 |
<xsl:if test="count($pages) > 0"> |
| 95 |
<ul class="toc"> |
| 96 |
<xsl:for-each select="$pages"> |
| 97 |
<li> |
| 98 |
<a> |
| 99 |
<xsl:attribute name="href"> |
| 100 |
<xsl:choose> |
| 101 |
<xsl:when test="@href"> |
| 102 |
<xsl:value-of select="@href"/> |
| 103 |
</xsl:when> |
| 104 |
<xsl:otherwise> |
| 105 |
<xsl:value-of select="$relpath"/> |
| 106 |
<xsl:value-of select="@dir"/> |
| 107 |
<xsl:value-of select="$filename-prefix"/> |
| 108 |
<xsl:value-of select="@filename"/> |
| 109 |
</xsl:otherwise> |
| 110 |
</xsl:choose> |
| 111 |
</xsl:attribute> |
| 112 |
<xsl:apply-templates select="title"/> |
| 113 |
</a> |
| 114 |
<xsl:if test="summary"> |
| 115 |
<xsl:text>--</xsl:text> |
| 116 |
<xsl:apply-templates select="summary"/> |
| 117 |
</xsl:if> |
| 118 |
</li> |
| 119 |
</xsl:for-each> |
| 120 |
</ul> |
| 121 |
</xsl:if> |
| 122 |
</xsl:template> |
| 123 |
|
| 124 |
<xsl:template match="toc/summary|tocentry/summary|notoc/summary"> |
| 125 |
<xsl:apply-templates/> |
| 126 |
</xsl:template> |
| 127 |
|
| 128 |
<!-- ==================================================================== --> |
| 129 |
|
| 130 |
</xsl:stylesheet> |