| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 |
<!-- |
|---|
| 3 |
Licensed to Jasig under one or more contributor license |
|---|
| 4 |
agreements. See the NOTICE file distributed with this work |
|---|
| 5 |
for additional information regarding copyright ownership. |
|---|
| 6 |
Jasig licenses this file to you under the Apache License, |
|---|
| 7 |
Version 2.0 (the "License"); you may not use this file |
|---|
| 8 |
except in compliance with the License. You may obtain a |
|---|
| 9 |
copy of the License at: |
|---|
| 10 |
|
|---|
| 11 |
http://www.apache.org/licenses/LICENSE-2.0 |
|---|
| 12 |
|
|---|
| 13 |
Unless required by applicable law or agreed to in writing, |
|---|
| 14 |
software distributed under the License is distributed on |
|---|
| 15 |
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|---|
| 16 |
KIND, either express or implied. See the License for the |
|---|
| 17 |
specific language governing permissions and limitations |
|---|
| 18 |
under the License. |
|---|
| 19 |
--> |
|---|
| 20 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
|---|
| 21 |
<xsl:template match="event"> |
|---|
| 22 |
{ |
|---|
| 23 |
"summary" : "<xsl:call-template name="escapeJson"><xsl:with-param name="string" select="summary"/></xsl:call-template>", |
|---|
| 24 |
"subscriptionId" : "<xsl:value-of select="subscription/id"/>", |
|---|
| 25 |
"calPath" : "<xsl:value-of select="calendar/encodedPath"/>", |
|---|
| 26 |
"guid" : "<xsl:call-template name="url-encode"><xsl:with-param name="str" select="guid"/></xsl:call-template>", |
|---|
| 27 |
"recurrenceId" : "<xsl:value-of select="recurrenceId"/>", |
|---|
| 28 |
"link" : "<xsl:value-of select='link'/>", |
|---|
| 29 |
"eventlink" : "http://events.rpi.edu/event/eventView.do?calPath=<xsl:value-of select="calendar/encodedPath"/>&guid=<xsl:call-template name="url-encode"><xsl:with-param name="str" select="guid"/></xsl:call-template>&recurrenceId=<xsl:value-of select="recurrenceId"/>", |
|---|
| 30 |
"status" : "<xsl:value-of select='status'/>", |
|---|
| 31 |
"start" : { |
|---|
| 32 |
"allday" : "<xsl:value-of select='start/allday'/>", |
|---|
| 33 |
"shortdate" : "<xsl:value-of select='start/shortdate'/>", |
|---|
| 34 |
"longdate" : "<xsl:value-of select='start/longdate'/>", |
|---|
| 35 |
"dayname" : "<xsl:value-of select='start/dayname'/>", |
|---|
| 36 |
"time" : "<xsl:value-of select='start/time'/>", |
|---|
| 37 |
"utcdate" : "<xsl:value-of select='start/utcdate'/>", |
|---|
| 38 |
"datetime" : "<xsl:value-of select='start/unformatted'/>", |
|---|
| 39 |
"timezone" : "<xsl:value-of select='start/timezone/id'/>" |
|---|
| 40 |
}, |
|---|
| 41 |
"end" : { |
|---|
| 42 |
"allday" : "<xsl:value-of select='end/allday'/>", |
|---|
| 43 |
"shortdate" : "<xsl:value-of select='end/shortdate'/>", |
|---|
| 44 |
"longdate" : "<xsl:value-of select='end/longdate'/>", |
|---|
| 45 |
"dayname" : "<xsl:value-of select='end/dayname'/>", |
|---|
| 46 |
"time" : "<xsl:value-of select='end/time'/>", |
|---|
| 47 |
"utcdate" : "<xsl:value-of select='end/utcdate'/>", |
|---|
| 48 |
"datetime" : "<xsl:value-of select='end/unformatted'/>", |
|---|
| 49 |
"timezone" : "<xsl:value-of select='end/timezone/id'/>" |
|---|
| 50 |
}, |
|---|
| 51 |
"location" : { |
|---|
| 52 |
"address" : "<xsl:call-template name="escapeJson"><xsl:with-param name="string" select="location/address"/></xsl:call-template>", |
|---|
| 53 |
"link" : "<xsl:value-of select='location/link'/>" |
|---|
| 54 |
}, |
|---|
| 55 |
"contact" : { |
|---|
| 56 |
"name" : "<xsl:call-template name="escapeJson"><xsl:with-param name="string" select="contact/name"/></xsl:call-template>", |
|---|
| 57 |
"phone" : "<xsl:value-of select="contact/phone"/>",<!-- |
|---|
| 58 |
"email" : "<xsl:value-of select="contact/email"/>", --> |
|---|
| 59 |
"link" : "<xsl:value-of select='contact/link'/>" |
|---|
| 60 |
}, |
|---|
| 61 |
"calendar" : { |
|---|
| 62 |
"name" : "<xsl:value-of select='calendar/name'/>", |
|---|
| 63 |
"displayName" : "<xsl:value-of select='calendar/summary'/>", |
|---|
| 64 |
"path" : "<xsl:value-of select='calendar/path'/>", |
|---|
| 65 |
"encodedPath" : "<xsl:value-of select='calendar/encodedPath'/>" |
|---|
| 66 |
}, |
|---|
| 67 |
"categories" : [ |
|---|
| 68 |
<xsl:for-each select='categories/category'>"<xsl:call-template name="escapeJson"><xsl:with-param name="string" select="value"/></xsl:call-template>"<xsl:if test='position() != last()'>,</xsl:if></xsl:for-each> |
|---|
| 69 |
], |
|---|
| 70 |
"description" : "<xsl:call-template name="escapeJson"><xsl:with-param name="string" select="description"/></xsl:call-template>", |
|---|
| 71 |
"cost" : "<xsl:call-template name="escapeJson"><xsl:with-param name="string" select="cost"/></xsl:call-template>", |
|---|
| 72 |
"xproperties" : [ |
|---|
| 73 |
<xsl:for-each select="xproperties/node()[name() != '']"> |
|---|
| 74 |
{ |
|---|
| 75 |
"<xsl:value-of select='name()'/>" : { |
|---|
| 76 |
"values" : { |
|---|
| 77 |
<xsl:for-each select="values/node()[name() != '']"> |
|---|
| 78 |
"<xsl:value-of select='name()'/>" : "<xsl:call-template name="escapeJson"><xsl:with-param name="string" select="."/></xsl:call-template>"<xsl:if test='position() != last()'>,</xsl:if> |
|---|
| 79 |
</xsl:for-each> |
|---|
| 80 |
} |
|---|
| 81 |
} |
|---|
| 82 |
}<xsl:if test='position() != last()'>,</xsl:if></xsl:for-each> |
|---|
| 83 |
|
|---|
| 84 |
] |
|---|
| 85 |
}<xsl:if test="position() != last()">,</xsl:if> |
|---|
| 86 |
</xsl:template> |
|---|
| 87 |
</xsl:stylesheet> |
|---|