Tuesday, 31 January 2017

Previous Month in xlst 1.0

This logic will be useful when your passing date value and try to looking for previous month.

<xsl:template name="PreviousMonth ">
    <xsl:param name="value"/>
    <xsl:if test="$value != ''">
      <xsl:variable name="year"
                    select="substring-before(substring-after(substring-after($value,'/'),'/'),' ')"/>
      <xsl:variable name="month"
                    select="substring-before(substring-after($value,'/'),'/')"/>
      <xsl:variable name="day"
                    select="substring-after(substring-after($value,'/'),'/')"/>
      <xsl:choose>
        <xsl:when test="$month = 01">
          <xsl:variable name="chgYear" select="$year - 1"/>
          <xsl:value-of select="concat('December',' ','12',',',$chgYear)"/>
        </xsl:when>
        <xsl:when test="$month='02'">
          <xsl:value-of select="concat('January',' ','12',',',$year)"/>
        </xsl:when>
        <xsl:when test="$month='03'">
          <xsl:value-of select="concat('February',' ','12',',',$year)"/>
        </xsl:when>
        <xsl:when test="$month='04'">
          <xsl:value-of select="concat('March',' ','12',',',$year)"/>
        </xsl:when>
        <xsl:when test="$month='05'">
          <xsl:value-of select="concat('April',' ','12',',',$year)"/>
        </xsl:when>
        <xsl:when test="$month='06'">
          <xsl:value-of select="concat('May',' ','12',',',$year)"/>
        </xsl:when>
        <xsl:when test="$month='07'">
          <xsl:value-of select="concat('June',' ','12',',',$year)"/>
        </xsl:when>
        <xsl:when test="$month='08'">
          <xsl:value-of select="concat('July',' ','12',',',$year)"/>
        </xsl:when>
        <xsl:when test="$month='09'">
          <xsl:value-of select="concat('August',' ','12',',',$year)"/>
        </xsl:when>
        <xsl:when test="$month='10'">
          <xsl:value-of select="concat('September',' ','12',',',$year)"/>
        </xsl:when>
        <xsl:when test="$month='11'">
          <xsl:value-of select="concat('October',' ','12',',',$year)"/>
        </xsl:when>
        <xsl:when test="$month='12'">
          <xsl:value-of select="concat('November',' ','12',',',$year)"/>
        </xsl:when>
        <xsl:otherwise/>
      </xsl:choose>
    </xsl:if>
  </xsl:template>

Input:

<outputDate>
<call-template name="PreviousMonth">
<xsl:with-param name="value">
<xsl:value-of select="11/01/2017 00:00:00"/>
</xsl:with-param>
</call-template>
</outputDate>

Output:

<outputDate>December 12,2016</outputDate>



Oracle Opatch utility 12c

 Hi Blog Viewers, This post will describes the how to apply single or multiple patches at a time. Prerequisites : Set the Oracle Home and Op...