File: page_rss_output.xsl

package info (click to toggle)
virtuoso-opensource 6.1.4%2Bdfsg1-7
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 245,116 kB
  • sloc: ansic: 639,631; sql: 439,225; xml: 287,085; java: 61,048; sh: 38,723; cpp: 36,889; cs: 25,240; php: 12,562; yacc: 9,036; lex: 7,149; makefile: 6,093; jsp: 4,447; awk: 1,643; perl: 1,017; ruby: 1,003; python: 329
file content (87 lines) | stat: -rw-r--r-- 3,690 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
<?xml version="1.0" encoding="utf-8"?>
<!--
 -  
 -  $Id: page_rss_output.xsl,v 1.4 2006/09/25 14:38:41 source Exp $
 -
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -  
 -  Copyright (C) 1998-2006 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" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <xsl:output method="xml" indent="yes"/>
	<xsl:include href="page_common.xsl"/>
	<xsl:param name="now_rfc1123"><?V date_rfc1123(now())?></xsl:param>
	
  <xsl:template match="tutorial">
    <?vsp
		  http_header ('Content-Type: text/xml\r\n');
      declare _path,_domain varchar;
      _domain := 'http://' || regexp_replace(HTTP_GET_HOST(),':80$','');
      _path := _domain || http_map_get('domain') || '/'; 
    ?>
		<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
		  <xsl:attribute name="dc" namespace="http://purl.org/dc/elements/1.1/"/>
			<channel>
				<title>
				  <xsl:choose>
				    <xsl:when test="//subsection[@wwwpath = $subsecpath]">
				      <xsl:value-of select="//subsection[@wwwpath = $subsecpath]/parent::section/@Title"/>
				      <xsl:text> - </xsl:text>
				      <xsl:value-of select="//subsection[@wwwpath = $subsecpath]/@Title"/>
				    </xsl:when>
				    <xsl:otherwise>OpenLink Virtuoso Features Demonstrations and Tutorials</xsl:otherwise>
				  </xsl:choose>
				</title>
				<link><?V _path ?><xsl:value-of select="$subsecpath"/><xsl:if test="$subsecpath != ''">/</xsl:if></link>
				<description/>
				<managingEditor>support@openlinksw.com</managingEditor>
				<pubDate><xsl:value-of select="$now_rfc1123"/></pubDate>
				<generator>Virtuoso Universal Server <?V sys_stat('st_dbms_ver') ?></generator>
				<webMaster>support@openlinksw.com</webMaster>
				<image>
					<title>OpenLink Virtuoso Features Demonstrations and Tutorials</title>
					<url><?V _domain ?>/images/leftlogo.gif</url>
					<link><?V _path ?><xsl:value-of select="$subsecpath"/><xsl:if test="$subsecpath != ''">/</xsl:if></link>
					<description/>
					<width>137</width>
					<height>35</height>
				</image>
				<xsl:choose>
				  <xsl:when test="//subsection[@wwwpath = $subsecpath]">
				  	<xsl:apply-templates select="//subsection[@wwwpath = $subsecpath]//example"/>
				  </xsl:when>
				  <xsl:otherwise>
						<xsl:apply-templates select="//example"/>
					</xsl:otherwise>
				</xsl:choose>
			</channel>
		</rss>
	</xsl:template>
	
	<xsl:template match="example">
		<item>
			<title><xsl:value-of select="normalize-space (refentry/refnamediv/refname)"/></title>
			<guid><?V _path ?><xsl:value-of select="@wwwpath"/></guid>
			<link><?V _path ?><xsl:value-of select="@wwwpath"/></link>
			<pubDate><xsl:value-of select="@date"/></pubDate>
			<description><xsl:value-of select="refentry/refnamediv/refpurpose"/></description>
			<dc:subject><xsl:value-of select="refentry/refnamediv/refname"/></dc:subject>
		</item>
	</xsl:template>
</xsl:stylesheet>