File: blog.xsl

package info (click to toggle)
virtuoso-opensource 6.1.6+dfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 260,992 kB
  • ctags: 125,220
  • sloc: ansic: 652,748; sql: 458,419; xml: 282,834; java: 61,031; sh: 40,031; cpp: 36,890; cs: 25,240; php: 12,692; yacc: 9,523; lex: 7,018; makefile: 6,157; jsp: 4,484; awk: 1,643; perl: 1,013; ruby: 1,003; python: 326
file content (383 lines) | stat: -rw-r--r-- 11,472 bytes parent folder | download | duplicates (2)
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
<?xml version="1.0"?>
<!--
 -
 -  $Id$
 -
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -
 -  Copyright (C) 1998-2012 OpenLink Software
 -
 -  This project is free software; you can redistribute it and/or modify it
 -  under the terms of the GNU General Public License as published by the
 -  Free Software Foundation; only version 2 of the License, dated June 1991.
 -
 -  This program is distributed in the hope that it will be useful, but
 -  WITHOUT ANY WARRANTY; without even the implied warranty of
 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 -  General Public License for more details.
 -
 -  You should have received a copy of the GNU General Public License along
 -  with this program; if not, write to the Free Software Foundation, Inc.,
 -  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 -
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:output method="xhtml"
  doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
  doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  indent="yes"/>

<xsl:template match="/">
<html>
<head>
  <title><xsl:value-of select="//title[1]"/>&apos;s Weblog</title>
  <link rel="alternate" type="application/rss+xml" title="RSS" href="{/blog/@base}rss.xml" />
<style>
<![CDATA[
  body {
    margin: 0px;
    padding: 0px;
    font-size: 75%;
    font-family: Verdana, 'Times New Roman', Helvetica, Utopia, Times, 'MS Serif', Serif;
    background-color: #eaeaea;
    color: Black;
  }
  h1 {
    margin-top: 10px; margin-bottom: 5px; margin-right: 3em;
    font-size: 185%;
    text-align: right;
  }

a { font-family: Verdana, Arial, Sans-Serif; text-decoration: none }
a:active { text-decoration: none }
a:visited { text-decoration: none }
a:hover { text-decoration: underline }

#header {
  margin: 0px;
  background-image: url(/images/logobg.jpg);
  color: white;
  text-align: right;
  width: 100%;
  height: 65px;
  }
#header IMG {
  float: left;
  margin: 0px;
  padding: 0px;
  height: 65px;
  }
#header H1 {
  margin-top: 0px;
  margin-bottom: 0px;
  padding-top: 15px;
  }
#navbartop {
  font-size: 90%;
  text-align: right;
  background: #c1c1ff;
  color: #003366;
  margin: 0px;
  padding-top: 3px;
  padding-bottom: 3px;
  width: 100%;
  }
#navbartop DIV { padding-right: 1em;}
#navbartop input { padding: 0px; margin: 0px; font-family: inherit; font-size: 100%; }
#navbartop A {
  background: #C1C1FF;
  color: #003366;
  }
 form { display: inline; width: 0px; padding: 0px; margin: 0px; }
 td.box {
   width: 200px;}
 td.box, #texttd {
   vertical-align: top;}
#text {
    width: auto;
    font-family: inherit;
    font-size: inherit;
  }
 div.box {
    background-color: #efefef;
    color: Black;
    border: 1px #9999cc solid;
    width: 200px;
    font-size: 90%;
 }
 #powered {
    color: black;
    text-align: center;
    margin-top: 15px;
    width: 100%;
 }
 .message {
   margin-bottom: 1.5em;
   padding-bottom: 4px;
    background:#fff;
    color: black;
    padding: 10px;
    padding-top: 0px;
    border: 1px solid silver;
 }
 .pubdate {
    font-family: Monaco, 'Andale Mono', 'Lucida Console', monospace;
    background: #efefef;
    color: black;
    padding: 3px;
    position: relative;
    top: -5px;
    border: 1px solid silver;
 }
 .desc {
    font-family: inherit;
    font-size: inherit;
 }
 .comment {
   font-size: 10pt;
   font-family: Tahoma, sans-serif;
   text-align: right;
 }
 #calendar {
 font-size: 10pt;
 font-family: Tahoma, sans-serif;
 text-align: center;
 border-collapse: collapse;
 }
 #calendar td, #calendar th { padding: 2px;}
 .calactive {
   background: url("/images/blog-active.png");
   background-repeat: no-repeat;
   background-position: center;
   color: white;
 }
 .calactive a {
   color: white;
 }
 .roll {
  border-top:1px solid #9999cc;
  padding-top:6px;
  margin-bottom:6px;
  margin-left: 6px;
  margin-right: 6px;
 }

]]>
</style>
</head>
<body>
 <div id="header">
   <img src="/images/bloglogo.jpg" alt="OpenLink Virtuoso Blog" />
   <h1><xsl:value-of select="/blog/title" />&apos;s Weblog</h1>
 </div>
 <div id="navbartop"><div>Entries: [ <xsl:call-template name="entrylist" /> ]</div></div>
 <table id="pagecontainer" cellspacing="10" cellpadding="0" border="0" width="100%">
   <tr>
    <td class="box">
      <div class="box">
      <xsl:apply-templates select="/blog/navigation/categories" />
      <div  align="left" class="roll" >
       <p class="caption">Keyword search</p>
       <form method="POST">
        <div>
        <input type="text" name="txt" value="" size="10" />
        <input type="submit" name="GO" value="GO" />
        </div>
        <div><input type="radio" name="srch_where" value="blog" checked="checked" />&#160;My Blog</div>
        <div><input type="radio" name="srch_where" value="web" />&#160;The Web</div>
       </form>
      </div>
      </div>
    </td>
    <td id="texttd">
      <xsl:apply-templates select="/blog/items" />
    </td>
    <td class="box">
      <div class="box">
      <xsl:apply-templates select="/blog/navigation/calendar" />
      <xsl:apply-templates select="/blog/navigation/blogroll" />
      <xsl:apply-templates select="/blog/navigation/ocs" />
      <xsl:apply-templates select="/blog/navigation/opml" />
      <!-- xsl:apply-templates select="/blog/navigation/channelroll" / -->
      <div class="roll" >
        <div align="center" style="margin-bottom: 3px;"><b>Syndication</b></div>
        <div><a href="rss.xml"><img src="/images/xml.gif" border="0"/><br />RSS</a></div>
        <div><a href="index.ocs">OCS</a></div>
        <div><a href="index.opml">OPML</a></div>
      </div>
      </div>
    </td>
   </tr>
 </table>
</body>
</html>
</xsl:template>

<xsl:template match="title|navigation" />

<xsl:template name="entrylist">
 <xsl:for-each select="/blog/items/item">
   <a href="#{id}"><xsl:number level="multiple" format=" 1 " count="item" /></a><xsl:if test="following-sibling::item"> | </xsl:if>
 </xsl:for-each>
</xsl:template>

<xsl:template match="items">
<div id="text">
  <xsl:if test="/blog/@category-name != ''">
  <h3>Category: "<xsl:value-of select="/blog/@category-name" />"</h3>
  </xsl:if>
  <xsl:apply-templates />
  <xsl:choose>
  <xsl:when test="not item and @search != ''">
  No messages found containing "<xsl:value-of select="@search" />".
  </xsl:when>
  <xsl:when test="not item and /blog/@category != ''">
  No messages found for category  "<xsl:value-of select="/blog/@category-name" />".
  </xsl:when>
  <xsl:when test="not item and @search = '' and /blog/@cat = ''">
  <div class="message">
  This is a placeholder for your new weblog.
  There are no posts currently.
  </div>
  </xsl:when>
  </xsl:choose>
  <div id="powered"><a href="http://www.openlinksw.com/virtuoso"><img src="/images/PoweredByVirtuosoSmall2.jpg"  border="0" /></a></div>
</div>
</xsl:template>

<xsl:template match="item">
  <a name="{id}" />
  <div class="message">
  <xsl:apply-templates select="pubDate"/>
  <xsl:apply-templates select="description"/>
  <div class="comment">
    <a href="#">
    <xsl:attribute name="onClick">javascript: window.open ('comments.vsp?postid=<xsl:value-of select="id"/>&amp;blogid=<xsl:value-of select="/blog/title/@blogid"/>','window','scrollbars=yes,resizable=yes,height=400,width=570,left=80,top=80'); return false;</xsl:attribute>Comments [<xsl:value-of select="comments"/>]
   </a>
   </div>
  </div>
</xsl:template>

<xsl:template match="description"><p class="desc"><xsl:value-of select="." disable-output-escaping = "yes" /></p></xsl:template>
<xsl:template match="pubDate"><div class="pubdate"><xsl:value-of select="." /></div></xsl:template>

<xsl:template match="blogroll">
  <div class="roll">
  <div align="center"><b>Blog Roll</b></div>
  <xsl:apply-templates />
  </div>
</xsl:template>

<xsl:template match="channelroll">
</xsl:template>

<xsl:template match="opml">
  <div class="roll">
  <div align="center" style="margin-bottom: 3px;"><b>OPML Links</b></div>
  <xsl:for-each select="link">
    <a><xsl:attribute name="href"><xsl:value-of select="@rss" /></xsl:attribute><b><xsl:value-of select="blog"/></b></a>
    <div style="margin-left:1em;">
    <xsl:apply-templates select="link"/>
    </div>
  </xsl:for-each>
  </div>
</xsl:template>

<xsl:template match="ocs">
  <div class="roll">
  <div align="center" style="margin-bottom: 3px;"><b>OCS Links</b></div>
  <xsl:for-each select="link">
    <a><xsl:attribute name="href"><xsl:value-of select="@rss" /></xsl:attribute><b><xsl:value-of select="blog"/></b></a>
    <div style="margin-left:1em;">
    <xsl:apply-templates select="link"/>
    </div>
  </xsl:for-each>
  </div>
</xsl:template>

<xsl:template match="categories[category]">
  <xsl:variable name="dt" select="concat(//calendar/@year, '-', //calendar/@month, '-', //calendar/@day)" />
  <div class="roll" style="border: none; border">
  <div align="center" style="margin-bottom: 3px;"><b>Categories</b></div>
   <div><a><xsl:attribute name="href">index.vsp?date=<xsl:value-of select="$dt"/>&amp;cat=</xsl:attribute><b>All</b></a></div>
  <xsl:for-each select="category">
   <div><a><xsl:attribute name="href">index.vsp?date=<xsl:value-of select="$dt"/>&amp;cat=<xsl:value-of select="@id" /></xsl:attribute><b><xsl:value-of select="@name"/></b></a></div>
  </xsl:for-each>
  </div>
</xsl:template>


<xsl:template match="link">
  <div>
  <xsl:if test="@rss != ''">
   <a><xsl:attribute name="href"><xsl:value-of select="@rss" /></xsl:attribute><img src="/images/mxml.gif" border="0"/></a>
  </xsl:if>
  <a><xsl:attribute name="href"><xsl:value-of select="@href" /></xsl:attribute><xsl:apply-templates /></a>
  </div>
</xsl:template>

<xsl:template match="calendar">
<table id="calendar">
  <caption>
    <xsl:value-of select="@monthname" />
     <xsl:text> </xsl:text>
     <xsl:value-of select="@year"/>
   </caption>
  <tr>
    <th>Sun</th>
    <th>Mon</th>
    <th>Tue</th>
    <th>Wed</th>
    <th>Thu</th>
    <th>Fri</th>
    <th>Sat</th>
  </tr>
  <xsl:apply-templates />
  <tr>
	<td colspan="3">
        <xsl:if test="@prev != ''">
        <a>
        <xsl:attribute name="href">index.vsp?date=<xsl:value-of select="@prev"/>&amp;cat=<xsl:value-of select="/blog/@category" /></xsl:attribute>
        <xsl:value-of select="@prev-label" />
        </a>
        </xsl:if>&#160;
        </td>
	<td>&#160;</td>
	<td colspan="3">
        <xsl:if test="@next != ''">
        &#160;
        <a>
        <xsl:attribute name="href">index.vsp?date=<xsl:value-of select="@next"/>&amp;cat=<xsl:value-of select="/blog/@category" /></xsl:attribute>
        <xsl:value-of select="@next-label" />
        </a>
        </xsl:if>
        </td>
</tr>
</table>
</xsl:template>

<xsl:template match="week">
  <tr>
    <xsl:apply-templates />
  </tr>
</xsl:template>

<xsl:template match="day">
  <xsl:variable name="dt" select="concat(ancestor::calendar/@year, '-', ancestor::calendar/@month, '-')" />
  <td>
    <xsl:choose>
    <xsl:when test="boolean(number(@active))">
    <xsl:attribute name="class">calactive</xsl:attribute><a>
    <xsl:attribute name="href">index.vsp?date=<xsl:value-of select="$dt"/><xsl:value-of select="."/>&amp;cat=<xsl:value-of select="/blog/@category" /></xsl:attribute>
    <xsl:apply-templates />
    </a>
    </xsl:when>
    <xsl:otherwise>
    <xsl:apply-templates />
    </xsl:otherwise>
    </xsl:choose>
  </td>
</xsl:template>

</xsl:stylesheet>