aboutsummaryrefslogtreecommitdiff
path: root/t/test-site/src/common/fillFeed.xsl
blob: 30d167ba04e1604b5feff7946fa22cbb7ca1c6d8 (plain)
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
<?xml version="1.0" encoding="utf-8"?>
<x:stylesheet xmlns:x="http://www.w3.org/1999/XSL/Transform"
              xmlns:wc="http://webcoso.thenautilus.net/"
              xmlns:a="http://www.w3.org/2005/Atom"
              xmlns="http://www.w3.org/1999/xhtml"
              exclude-result-prefixes="wc"
              version="1.0">
 
 <x:import href="du2html.xsl"/>
 
 <x:param name="language" select="'en'"/>
 <x:param name="path"/>
 <x:param name="filename"/>
 
 <x:output method="xml" encoding="utf-8" doctype-public=""/>
 
 <x:template match="a:feed">
  <a:feed xml:lang="{$language}" xml:base="http://www.thenautilus.net/">
   <a:author>
    <a:name>Gianni Ceccarelli</a:name>
    <a:email>dakkar@thenautilus.net</a:email>
   </a:author>
   <a:id>http://www.thenautilus.net/</a:id>
   <a:link rel="alternate" type="text/html" href="http://www.thenautilus.net{wc:dst-uri-for($filename)}"/>
   <a:title type="text">thenautilus.net</a:title>
   <x:copy-of select="a:updated"/>
   <x:apply-templates select="a:entry"/>
  </a:feed>
 </x:template>
 
 <x:template match="a:entry">
  <a:entry>
   <x:copy-of select="a:id"/>
   <x:copy-of select="a:published"/>
   <x:copy-of select="a:updated"/>
   <x:apply-templates select="a:PH"/>
  </a:entry>
 </x:template>
 
 <x:template match="a:PH">
  <a:link rel="alternate" type="text/html"><x:value-of select="."/></a:link>
  <a:title type="xhtml">
   <div xml:base="{.}">
    <x:apply-templates select="wc:title-for($language,$filename,.)/node()"/>
   </div>
  </a:title>
  <a:content type="xhtml">
   <div xml:base="{.}">
   <x:apply-templates select="wc:document($language,$filename,.)/document/node()"/>
   </div>
  </a:content>
  <x:for-each select="wc:document($language,$filename,.)/document/docinfo/field[field_name='tags']/field_body">
   <x:for-each select="*/list_item|paragraph">
    <a:category term="{normalize-space(.)}" label="{normalize-space(string(wc:title-for($language,$filename,concat('/tags/',normalize-space(.),'/'))))}"/>
   </x:for-each>
  </x:for-each>
 </x:template>
 
</x:stylesheet>