Manipulate value from XML
Hello
I'm new to XSLT.
I have this XML-document:
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="test.xsl" ?>
<Calendar>
<Info>
<CalendarID>743</CalendarID>
<CalendarName><![CDATA[Outlook]]></CalendarName>
<AppointmentInterval>5 days</AppointmentInterval>
<RefreshInterval>5 minutes</RefreshInterval>
<FreeAccessUntil>2015-10-17 14:49:53</FreeAccessUntil>
</Info>
<Appointment>
<Ressource><![CDATA[Ian David Jensen]]></Ressource>
<StartDate>2015-09-18 10:00:00</StartDate>
<EndDate>2015-09-18 11:00:00</EndDate>
<Subject><![CDATA[Statusmøde - MediaConnect ApS]]></Subject>
<Description><![CDATA[NÃ¥r: 31/07/2015 09.00.00 (tilbagevendende)
Hvor: Broen
--
Ugentligt statusmøde for medarbejdere i MediaConnect]]></Description>
<Field1><![CDATA[]]></Field1>
<Field2><![CDATA[]]></Field2>
<Location><![CDATA[]]></Location>
<Id>3747939</Id>
</Appointment>
<Appointment>
<Ressource><![CDATA[Ian David Jensen]]></Ressource>
<StartDate>2015-09-19 09:00:00</StartDate>
<EndDate>2015-09-19 12:00:00</EndDate>
<Subject><![CDATA[Møde med Horsens Kommune]]></Subject>
<Description><![CDATA[Møde omkring deres sidste løsning. Skal der udbygges og har de ændringer?
]]></Description>
<Field1><![CDATA[]]></Field1>
<Field2><![CDATA[]]></Field2>
<Location><![CDATA[]]></Location>
<Id>3747940</Id>
</Appointment>
<Appointment>
<Ressource><![CDATA[Ian David Jensen]]></Ressource>
<StartDate>2015-09-20 09:00:00</StartDate>
<EndDate>2015-09-20 13:00:00</EndDate>
<Subject><![CDATA[Ã
bent hus hos InfoSystemer]]></Subject>
<Description><![CDATA[Infosystemer inviterer til åbent hus, der vil være fremvisning af nye løsninger.
]]></Description>
<Field1><![CDATA[]]></Field1>
<Field2><![CDATA[]]></Field2>
<Location><![CDATA[]]></Location>
<Id>3747941</Id>
</Appointment>
</Calendar>
I want to manipulate the StartDate and EndDate. I want to take off 30 minutes from each timestamp.
Right now I have this stylesheet:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
<HTML>
<style>
table, td, tr{
border: 1px solid black;
border-collapse: collapse;
padding:10px;
}
</style>
<HEAD>
</HEAD>
<BODY>
<table width="100%">
<caption><h1>Dagens møder</h1></caption>
<tr>
<th>Mødearrangør</th>
<th>Start</th>
<th>Slut</th>
<th>Emne</th>
<th>Beskrivelse</th>
</tr>
<xsl:for-each select="//Calendar/Appointment">
<tr>
<td><xsl:value-of select="Ressource"/></td>
<td><xsl:value-of select="StartDate"/></td>
<td><xsl:value-of select="EndDate"/></td>
<td><xsl:value-of select="Subject"/></td>
<td><xsl:value-of select="Description"/></td>
</tr>
</xsl:for-each>
</table>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
|