XML : Using xslt 1.0 i want to add days to current date when

XSLT im using: Is this valid using java syntax for xslt. I do not have a xml transformation tool that supports java for my validation. So i'm not sure if the syntax is correct. If not could anyone please let me know if there is any other approach that I can take. So if the RequestedDeliveryDate is less than current date then add 5 days to current date and that will be the new RequestedDeliveryDate

`

  <xsl:template match="@* | node()">      <xsl:copy>          <xsl:apply-templates select="@* | node()" />       </xsl:copy>  </xsl:template>    <xsl:template match="/tXML/Message/Order/OrderLines/OrderLine/ShippingInfo/RequestedDeliveryBy">      <xsl:choose>          <xsl:when test="(java:format(java:java.text.SimpleDateFormat.new('MM/dd/yyyy HH:mm'), java:java.util.Date.new()) &gt;= '.')">              <RequestedDeliveryBy>                  <xsl:value-of select="java:format(java:java.text.SimpleDateFormat.new('MM/dd/yyyy HH:mm'), java:java.util.Date.new(),5)" />              </RequestedDeliveryBy>          </xsl:when>                       <xsl:otherwise>              <xsl:value-of select="." />                  </xsl:otherwise>          </xsl:choose>                          </xsl:template>    

`

No comments:

Post a Comment