aboutsummaryrefslogtreecommitdiff
path: root/share/sgml/xhtml.xsl
blob: e7bdc119447d3b27de0bee581908f7b75158c7ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE xsl:stylesheet PUBLIC "-//FreeBSD//DTD FreeBSD XSLT 1.0 DTD//EN"
"http://www.FreeBSD.org/XML/www/share/sgml/xslt10-freebsd.dtd">
<!-- $FreeBSD$ -->

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:cvs="http://www.FreeBSD.org/XML/CVS"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:str="http://exslt.org/strings"
  xmlns="http://www.w3.org/1999/xhtml"
  exclude-result-prefixes="cvs xhtml"
  extension-element-prefixes="str">

  <xsl:variable name="rsslink" select="''"/>

  <xsl:variable name="rsstitle" select="''"/>

  <xsl:variable name="svnKeyword">
    <xsl:value-of select="normalize-space(//cvs:keyword[1])"/>
  </xsl:variable>

  <xsl:variable name="date">
    <xsl:value-of select="str:split($svnKeyword, ' ')[4]"/>
  </xsl:variable>

  <xsl:variable name="title">
    <xsl:value-of select="/xhtml:html/xhtml:head/xhtml:title"/>
  </xsl:variable>

  <xsl:output type="xml" encoding="&xml.encoding;"
    indent="yes"
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />

  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
	<title><xsl:value-of select="$title" /></title>
	<meta http-equiv="Content-Type" content="text/html; charset=&xml.encoding;" />
	<meta name="MSSmartTagsPreventParsing" content="TRUE" />
	<xsl:copy-of select="/xhtml:html/xhtml:head/xhtml:meta"/>
	<link rel="shortcut icon" href="&enbase;/favicon.ico" type="image/x-icon" />
	<link rel="icon" href="&enbase;/favicon.ico" type="image/x-icon" />
<!--
FOR TRANSLATORS:

Do not translate the "Normal Text" and "Large Text" attributes in the
following two lines.  They are not literal texts but JavaScript
parameters.  Changing them will result in rendering errors.
-->
	<link rel="stylesheet" media="screen" href="&stylesheet;" type="text/css" title="Normal Text" />
	<link rel="alternate stylesheet" media="screen" href="&stylesheetlarge;" type="text/css" title="Large Text" />
	<xsl:copy-of select="/xhtml:html/xhtml:head/xhtml:link"/>
	<xsl:call-template name="process.rss.link"/>
	<script type="text/javascript" src="&enbase;/layout/js/styleswitcher.js"></script>
	&header1.googlejs;
      </head>

      <body>
	<div id="containerwrap">
	  <div id="container">
	    &header2.skipnav;

	    <div id="headercontainer">
	      <div id="header">

		&header2.logo-red.label;

		<div id="headerlogoleft">
		  &header2.logo-red;
		</div> <!-- HEADERLOGOLEFT -->

		<div id="headerlogoright">
		  &header2.searchnav.label;

		  &header2.searchnav;

		<div id="SEARCH">
		  <form action="&cgibase;/search.cgi" method="get">
		    <div>
		      <h2 class="blockhide"><label for="WORDS">&header2.word.search;</label></h2>

		      &header2.searchinputs;
		    </div>
		  </form>
		</div> <!-- SEARCH -->
	      </div> <!-- HEADERLOGORIGHT -->
	    </div> <!-- HEADER -->

	    &header2.topnav.label;

	    &header2.topnav;

	  </div> <!-- HEADERCONTAINER -->

	  <div id="content">
	      <xsl:call-template name="process.content"/>
	    </div> <!-- CONTENT -->

	    <div id="footer">
	      <xsl:call-template name="process.footer"/>
	    </div> <!-- FOOTER -->
	  </div> <!-- CONTAINER -->
	</div> <!-- CONTAINERWRAP -->
      </body>
    </html>
  </xsl:template>

  <xsl:template name="process.rss.link">
    <xsl:if test="$rsslink != ''">
      <link rel="alternate" type="application/rss+xml"
	title="{$rsstitle}" href="{$rsslink}" />
    </xsl:if>
  </xsl:template>

  <xsl:template name="process.sidewrap">
              <xsl:choose xmlns:xhtml="http://www.w3.org/1999/xhtml">
                <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.about'">
                  &nav.about;
                </xsl:when>

                <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.community'">
                  &nav.community;
                </xsl:when>

                <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.developers'">
                  &nav.developers;
                </xsl:when>

                <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.docs'">
                  &nav.docs;
                </xsl:when>

                <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.download'">
                  &nav.download;
                </xsl:when>

                <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.gnome'">
                  &nav.gnome;
                </xsl:when>

                <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.ports'">
                  &nav.ports;
                </xsl:when>

                <xsl:when test="xhtml:html/xhtml:body/@class = 'navinclude.support'">
                  &nav.support;
                </xsl:when>
              </xsl:choose>
  </xsl:template>

  <xsl:template name="process.content">
	    <div id="sidewrap">
      <xsl:call-template name="process.sidewrap"/>
	    </div> <!-- SIDEWRAP -->

	    <div id="contentwrap">
      <xsl:call-template name="process.contentwrap"/>
	    </div> <!-- CONTENTWRAP -->

	    <br class="clearboth" />
  </xsl:template>

  <xsl:template name="process.contentwrap">
    <h1><xsl:value-of select="$title" /></h1>

    <xsl:copy-of xmlns:xhtml="http://www.w3.org/1999/xhtml" select="xhtml:html/xhtml:body/*" />
  </xsl:template>

  <xsl:template name="process.footer">
    &copyright;<br/>
    <xsl:if test="$date != ''">
      &lastmod; <xsl:value-of select="$date"/>
    </xsl:if>
  </xsl:template>
</xsl:stylesheet>