Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 18th, 2015, 02:47 AM
Registered User
 
Join Date: Sep 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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>
 
Old September 22nd, 2015, 09:47 PM
Authorized User
 
Join Date: Mar 2015
Posts: 34
Thanks: 3
Thanked 2 Times in 2 Posts
Default

I am new too just learning. Thanks for sharing here.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to manipulate diagramms? zip Crystal Reports 1 June 12th, 2006 11:20 AM
how to manipulate recordsets allang PHP Databases 1 September 25th, 2004 01:21 PM
manipulate recordset k2_andy Access VBA 1 May 30th, 2004 05:46 PM
manipulate variable Thodoris SQL Server 2000 2 May 28th, 2004 03:27 AM
how to manipulate recordset allang Classic ASP Databases 1 November 3rd, 2003 05:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.