-
Notifications
You must be signed in to change notification settings - Fork 0
/
stylesheet-wp.xsl
108 lines (88 loc) · 3.01 KB
/
stylesheet-wp.xsl
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
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wp="http://wordpress.org/export/1.2/"
xmlns:content="http://purl.org/rss/1.0/modules/content/">
<xsl:template match="/rss/channel" mode="get-title">
WP Extended RSS:
<xsl:value-of select="title" />
</xsl:template>
<xsl:template match="wp:category|wp:tag" mode="show">
<tr class="short">
<td>
[<xsl:value-of select="position()" />]
<xsl:call-template name="start-tag">
<xsl:with-param name="class" select="'short-name'" />
</xsl:call-template>
</td>
<xsl:variable name="n"><xsl:value-of select="wp:category_nicename" /><xsl:value-of select="wp:tag_name" /></xsl:variable>
<td><xsl:value-of select="wp:cat_name" /><xsl:value-of select="wp:tag_name" /></td>
<td><xsl:value-of select="count(../item/category[@nicename = $n])" /></td>
</tr>
<tr class="long">
<td colspan="3">
<xsl:apply-templates select="." mode="inside"/>
</td>
</tr>
</xsl:template>
<xsl:template match="wp:category|wp:tag" mode="inside">
<xsl:call-template name="element-block" />
</xsl:template>
<xsl:template match="wp:category[1]">
<table>
<tr>
<th></th>
<th>Name</th>
<th>Item count</th>
</tr>
<xsl:apply-templates select="../wp:category|../wp:tag" mode="show" />
</table>
</xsl:template>
<xsl:template match="wp:tag[1]">
<xsl:if test="count(../wp:category) = 0">
<table>
<tr>
<th></th>
<th>Name</th>
</tr>
<xsl:apply-templates select="../wp:category|../wp:tag" mode="show" />
</table>
</xsl:if>
</xsl:template>
<xsl:template match="wp:category|wp:tag">
</xsl:template>
<xsl:template match="item" mode="show">
<tr class="short">
<td>
[<xsl:value-of select="position()" />]
<xsl:call-template name="start-tag">
<xsl:with-param name="class" select="'short-name'" />
</xsl:call-template>
</td>
<td><xsl:value-of select="wp:post_type" /></td>
<td><xsl:value-of select="title" /></td>
<!-- <td><xsl:value-of select="content:encoded" disable-output-escaping="yes" /></td> -->
</tr>
<tr class="long">
<td colspan="4">
<xsl:apply-templates select="." mode="inside"/>
</td>
</tr>
</xsl:template>
<xsl:template match="item" mode="inside">
<xsl:call-template name="element-block" />
</xsl:template>
<xsl:template match="item[1]">
<table>
<tr>
<th></th>
<th>Type</th>
<th>Title</th>
<th>Content</th>
</tr>
<xsl:apply-templates select="../item" mode="show" />
</table>
</xsl:template>
<xsl:template match="item">
</xsl:template>
</xsl:stylesheet>