I want to display the total amount spilttup for each day. I tried with below code .functx:next-day function is used for setting the date filed.
Input
StartDate="04-12-2017"
NoDays = 6
Price=15540
But i want to show the result as shown below. Is there any other function is requird to set the date field value.
Current output:
<Night>
<Price Amount="2590" NightDate="2017-12-05" />
<Price Amount="2590" NightDate="2017-12-06" />
<Price Amount="2590" NightDate="2017-12-07" />
<Price Amount="2590" NightDate="2017-12-08" />
<Price Amount="2590" NightDate="2017-12-09" />
<Price Amount="2590" NightDate="2017-12-10" />
</Night>
Expected Output:
<Night>
<Price Amount="2590" NightDate="2017-12-04" />
<Price Amount="2590" NightDate="2017-12-05" />
<Price Amount="2590" NightDate="2017-12-06" />
<Price Amount="2590" NightDate="2017-12-07" />
<Price Amount="2590" NightDate="2017-12-08" />
<Price Amount="2590" NightDate="2017-12-09" />
</Night>
Currently used Logic:
<Night>
<xsl:for-each select="1 to $NoDays">
<Price>
<xsl:attribute name="Amount">
<xsl:value-of select="$Price div $NoDays"/>
</xsl:attribute>
<xsl:attribute name="NightDate">
<xsl:value-of select="functx:next-
day(xs:date($StartDate),position())"/>
</xsl:attribute>
</Price>
</xsl:for-each>