-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFeedItemToGridTransformer.xsl
More file actions
70 lines (59 loc) · 2.17 KB
/
FeedItemToGridTransformer.xsl
File metadata and controls
70 lines (59 loc) · 2.17 KB
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
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />
<xsl:template match="/">
<div class="RootNode">
<xsl:apply-templates select="Objects/Object" />
</div>
</xsl:template>
<xsl:template match="Objects/Object">
<div class="item-box">
<xsl:apply-templates select="Property[@Name='Publication']" />
<xsl:apply-templates select="Property[@Name='Title']" />
<xsl:apply-templates select="Property[@Name='Description']" />
<xsl:apply-templates select="Property[@Name='author']" />
<xsl:apply-templates select="Property[@Name='PubDate']" />
</div>
</xsl:template>
<xsl:template match="Property[@Name='Publication']">
<div class="item-header-bar">
<xsl:attribute name="style">color: white; background-color: #<xsl:value-of select="../Property[@Name='Color']" />
</xsl:attribute>
<xsl:value-of select="." disable-output-escaping="yes"/>
-
<xsl:apply-templates select="../Property[@Name='Stream']" />
</div>
</xsl:template>
<xsl:template match="Property[@Name='Stream']">
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:template>
<xsl:template match="Property[@Name='Title']">
<div class="item-title">
<a>
<xsl:attribute name="href">
<xsl:value-of select="../Property[@Name='link']" disable-output-escaping="yes"/>
</xsl:attribute>
<xsl:value-of select="." />
</a>
</div>
</xsl:template>
<xsl:template match="Property[@Name='Description']">
<div class="item-content">
<xsl:value-of select="substring(.,0,150)" disable-output-escaping="yes" /> ...
</div>
</xsl:template>
<xsl:template match="Property[@Name='author']">
<xsl:if test=". != ''">
<div class="item-author">
by <xsl:value-of select="." disable-output-escaping="yes" />
</div>
</xsl:if>
</xsl:template>
<xsl:template match="Property[@Name='PubDate']">
<div class="item-date">
<xsl:value-of select="." disable-output-escaping="yes" />
</div>
</xsl:template>
</xsl:stylesheet>