Reporting calendar events to opensync when doing slow sync.
[gdataplugin.git] / src / osync2gcal.xslt
blobb205d032db64134c5b00f00d27659ee9093faba6
1 <?xml version="1.0" ?>
2 <xsl:stylesheet version="1.0"
3 xmlns="http://www.w3.org/2005/Atom"
4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 xmlns:gd="http://schemas.google.com/g/2005">
7 <xsl:output method="xml" indent="yes"/>
9 <xsl:template match="child::event">
10 <entry>
12 <id>
13 <xsl:value-of select="descendant::Uid/Content"/>
14 </id>
16 <published>
17 <xsl:value-of select="descendant::Created/Content"/>
18 </published>
20 <updated>
21 <xsl:value-of select="descendant::LastModified/Content"/>
22 </updated>
24 <category>
25 <xsl:attribute name="scheme">http://schemas.google.com/g/2005#kind</xsl:attribute>
26 <xsl:attribute name="term">http://schemas.google.com/contact/2008#event</xsl:attribute>
27 </category>
29 <title>
30 <xsl:attribute name="type">text</xsl:attribute>
31 <xsl:value-of select="descendant::Description/Content"/>
32 </title>
34 <content>
35 <xsl:attribute name="type">text</xsl:attribute>
36 <xsl:value-of select="descendant::Comment/Content"/>
37 </content>
39 <link>
40 <xsl:attribute name="rel">edit</xsl:attribute>
41 <xsl:attribute name="type">application/atom+xml</xsl:attribute>
42 <xsl:attribute name="href">
43 <xsl:value-of select="descendant::Url/Content"/>
44 </xsl:attribute>
45 </link>
47 <author>
48 <name><xsl:value-of select="descendant::Contact/Content"/></name>
49 <!-- TODO: add author's email -->
50 </author>
52 <!-- Hard-coded for while... -->
53 <gd:visibility value="http://schemas.google.com/g/2005#event.default"/>
54 <gd:transparency value="http://schemas.google.com/g/2005#event.opaque"/>
56 <gd:eventStatus>
57 <xsl:attribute name="value">
58 <xsl:choose>
59 <xsl:when test="descendant::Status/Content = 'CONFIRMED'">http://schemas.google.com/g/2005#event.confirmed</xsl:when>
60 <xsl:otherwise>http://schemas.google.com/g/2005#event.cancelled</xsl:otherwise>
61 </xsl:choose>
62 </xsl:attribute>
63 </gd:eventStatus>
65 <gd:when>
66 <xsl:attribute name="startTime"><xsl:value-of select="descendant::DateStarted/Content"/></xsl:attribute>
67 <xsl:attribute name="endTime"><xsl:value-of select="descendant::DateEnd/Content"/></xsl:attribute>
68 </gd:when>
70 <gd:where>
71 <xsl:attribute name="valueString"><xsl:value-of select="descendant::Location/Content"/></xsl:attribute>
72 </gd:where>
75 </entry>
77 </xsl:template>
80 </xsl:stylesheet>