I need to add 90 days to the current date populated in the 2nd half of this code. I've attached the resulting XML below (using xml1.0 and xalan 2.7.1), it looks great i just need Licensing_End_Window to read 90days post todays date and can't figure it out for the life of me. Note this is just a snippet of the XSLT and resulting XML.
<xsl:element name="App_Data">
<xsl:attribute name="App">MOD</xsl:attribute>
<xsl:attribute name="Name">Licensing_Window_Start</xsl:attribute>
<xsl:attribute name="Value">
<xsl:variable name="s" select="SimpleDateFormat:new('MM-dd-yyyy')"/>
<xsl:variable name="Date" select="Date:new()"/>
<xsl:choose>
<xsl:when test="add:FlightStart"><xsl:value-of select="substring(add:FlightStart,1,10)"/></xsl:when>
<xsl:otherwise>
<xsl:value-of select="SimpleDateFormat:format($s,$Date)" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
<xsl:element name="App_Data">
<xsl:attribute name="App">MOD</xsl:attribute>
<xsl:attribute name="Name">Licensing_Window_End</xsl:attribute>
<xsl:attribute name="Value">
<xsl:variable name="s" select="SimpleDateFormat:new('MM-dd-yyyy')"/>
<xsl:variable name="Date" select="Date:new()"/>
<xsl:choose>
<xsl:when test="add:FlightEnd"><xsl:value-of select="substring(add:FlightEnd,1,10)"/></xsl:when>
<xsl:otherwise>
<xsl:value-of select="SimpleDateFormat:format($s,$Date)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
Resulting XML
<Name="Licensing_Window_Start" Value="12-10-2014"/><App_Data App="MOD" Name="Licensing_Window_End" Value="12-10-2014"/><App_Data App="MOD"
See Question&Answers more detail:os