root/trunk/deployment/webuser/webapp/resources/demoskins/default/PDA/ical.xsl

Revision 952 (checked in by douglm, 7 years ago)

--

Line 
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3 <xsl:output
4   method="text"
5   indent="no"
6   media-type="text/calendar"
7 />
8
9 <xsl:strip-space elements="*"/>
10   <!-- ================= -->
11   <!--  iCAL STYLESHEET  -->
12   <!-- ================= -->
13
14   <!-- MAIN TEMPLATE -->
15   <xsl:template match="/">
16     <xsl:apply-templates select="/ucalendar/event"/>
17   </xsl:template>
18
19   <!--==== SINGLE EVENT ====-->
20   <xsl:template match="event">
21 BEGIN:VCALENDAR
22 BEGIN:VEVENT
23 ORGANIZER:<xsl:value-of select="sponsor/name"/>
24 MAILTO:<xsl:value-of select="sponsor/email"/>
25 DTSTART:<xsl:value-of select="start/fourdigityear"/><xsl:value-of select="start/twodigitmonth"/><xsl:value-of select="start/twodigitday"/>T<xsl:value-of select="start/twodigithour24"/><xsl:value-of select="start/twodigitminute"/>00
26 DTEND:<xsl:value-of select="end/fourdigityear"/><xsl:value-of select="end/twodigitmonth"/><xsl:value-of select="end/twodigitday"/>T<xsl:choose><xsl:when test="start/time='' and end/time=''">235959</xsl:when><xsl:when test="(end/longdate = start/longdate) and (end/twodigithour24 &lt; start/twodigithour24)"><xsl:value-of select="start/twodigithour24"/><xsl:value-of select="end/twodigitminute"/>00</xsl:when><xsl:otherwise><xsl:value-of select="end/twodigithour24"/><xsl:value-of select="end/twodigitminute"/>00</xsl:otherwise></xsl:choose>
27 LOCATION:<xsl:value-of select="location/address"/>
28 TRANSP:OPAQUE
29 SEQUENCE:0
30 UID:<xsl:value-of select="startdate"/><xsl:value-of select="starttime"/>_<xsl:value-of select="id"/>@<xsl:value-of select="/ucalendar/urlprefix"/>
31 DESCRIPTION:<xsl:value-of select="normalize-space(description)"/><xsl:if test="cost!=''">\nCost: <xsl:value-of select="cost"/></xsl:if><xsl:if test="sponsor/name!=''">\nSponsor: <xsl:value-of select="sponsor/name"/></xsl:if><xsl:if test="sponsor/phone!=''">\nSponsor phone: <xsl:value-of select="sponsor/phone"/></xsl:if>\n
32 SUMMARY:<xsl:value-of select="summary"/>
33 PRIORITY:5
34 CLASS:PUBLIC
35 END:VEVENT
36 END:VCALENDAR
37
38   </xsl:template>
39 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.