This discussion is archived
3 Replies Latest reply: Apr 3, 2012 7:23 AM by user12679330 RSS

incrementing date part from a given dateandTime value.

user12679330 Newbie
Currently Being Moderated

I have a requirement where in I will get a date value from a

declare namespace xf = "";
declare namespace ns0 = "";
declare namespace s01 = "";
declare namespace ns1 = "";

declare function xf:input_to_reeive($abc as element(ns0:rootelement))
as element(s01:MainStatus) {
<s01:uniqueId>{ data($abc/ns1:header/ns1:id) }</s01:uniqueId>
<s01:createdDate>{ data($abc/ns1:header/ns1:createdTime) }</s01:createdDate>
<s01:expiryDate>xf:expiryDate(data($abc/ns1:header/ns1:createdTime))</v01:expiryDate> // this functionality is what expected.

declare variable $abc as element(ns0:rootelement) external;


in the above xquer I have tupdate the expiryDate as, reading the value from the createdTime, i have to increment the date value as +1.

suppose my input is having for this data($abc/ns1:header/ns1:createdTime) as *2009-08-01T10:10:10*
I have to update the expiryDate as *2009-08-02T10:10:10* (exactly 24 hours later for/from the creation time value).

Could you please advice how i can do this, in the same xquery function above shown, adding another function to it and calling it from the expiryDate element to get the increment date value.


Edited by: user12679330 on 03-Apr-2012 05:53

Edited by: user12679330 on 03-Apr-2012 06:07

Edited by: user12679330 on 03-Apr-2012 06:10

Edited by: user12679330 on 03-Apr-2012 06:10


  • Correct Answers - 10 points
  • Helpful Answers - 5 points