0

I have seen this similar question:

How to Increment 1 day in Date using XSLT

But the accepted answer is for XSLT-2 and I need XSLT-1.

Sample XML (word wrapped for clarify):

<Date Day="30" 
      DayShort="Sun" 
      DayFull="Sunday" 
      Month="10" 
      MonthShort="Oct" 
      MonthFull="October" 
      Year="2022" 
      Memorial="0" 
      AllDayEvent="0" 
      StartTime="9:30" 
      StartTime24="9:30" 
      EndTime12="4:20" 
      EndTime24="16:20" 
      MidweekEvent="1">30/10/2022</Date>

How can I take that date and add one day to it?

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164

1 Answers1

1

There's no native support for date-time arithmetic in XSLT 1.0.

You may be able to make use of the EXSLT date/time extensions (http://exslt.org) but availability of these functions varies from one XSLT processor to another.

Alternatively your XSLT processor may provide the ability to call out to functions written in another language.

You could of course write the logic yourself, it's tedious but not especially difficult.

Michael Kay
  • 156,231
  • 11
  • 92
  • 164