How can we Update the variable value in a loop after the return?
let $daysList := (1 to functx:days-in-month(xs:date(xs:date(current-date()))))
let $temp:=0
for $day in $daysList
for $x in doc("booking2.xml")/bookings/booking
where $x/roomNo = 301
let $CheckInday := day-from-date(xs:date($x/checkInDate))
let $CheckOutday := day-from-date(xs:date($x/checkOutDate))
let $daysDiff := xs:date($x/checkOutDate) - xs:date($x/checkInDate)
let $daysFromDuration := days-from-duration(xs:dayTimeDuration(xs:dayTimeDuration($daysDiff)))+1
return
if($day >= $CheckInday and $day <= $CheckOutday) then
if( $day = $CheckInday ) then
let $temp = 1;
<td colspan="{$daysFromDuration}" class="btn-success text-center">
{
$x/custFirstName
}
</td>
else ''
else
<td>{$day}</td>
In Above code, I want to update the value of $temp variable. Right now it's not allowed me to do this
let $temp := 1;
Is there any Idea to achieve these.
Thanks In Advance.