Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <xsl:template name="StringFormatDate">
- <xsl:param name="format" />
- <xsl:param name="day"/>
- <xsl:param name="month"/>
- <xsl:param name="year"/>
- <xsl:param name="withDot" />
- <xsl:variable name="prop_EndChars">
- <xsl:call-template name="templ_prop_EndChars"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$format = ''"></xsl:when>
- <xsl:when test="substring($format, 1, 2) = '%%'">
- <xsl:text>%</xsl:text>
- <xsl:call-template name="StringFormatDate">
- <xsl:with-param name="format" select="substring($format, 3)" />
- <xsl:with-param name="day" select="$day"/>
- <xsl:with-param name="month" select="$month"/>
- <xsl:with-param name="year" select="$year"/>
- <xsl:with-param name="withDot" select="$withDot" />
- </xsl:call-template>
- <xsl:if test="string-length($format)=2 and withDot = 'yes' and not(contains($prop_EndChars, '%'))">
- <xsl:call-template name="templ_prop_Dot"/>
- </xsl:if>
- </xsl:when>
- <xsl:when test="substring($format, 1, 1) = '%'">
- <xsl:variable name="what" select="substring($format, 2, 1)" />
- <xsl:choose>
- <xsl:when test="$what = 'D'">
- <xsl:value-of select="$day"/>
- </xsl:when>
- <xsl:when test="$what = 'M'">
- <xsl:value-of select="$month"/>
- </xsl:when>
- <xsl:when test="$what = 'Y'">
- <xsl:value-of select="$year"/>
- </xsl:when>
- </xsl:choose>
- <xsl:call-template name="StringFormatDate">
- <xsl:with-param name="format" select="substring($format, 3)" />
- <xsl:with-param name="day" select="$day"/>
- <xsl:with-param name="month" select="$month"/>
- <xsl:with-param name="year" select="$year"/>
- <xsl:with-param name="withDot" select="$withDot" />
- </xsl:call-template>
- <xsl:if test="string-length($format)=2 and withDot='yes'">
- <xsl:variable name="temp2">
- <xsl:call-template name="handleSpaces">
- <xsl:with-param name="field">
- <xsl:call-template name="formatNameOneItem">
- <xsl:with-param name="format" select="$what"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="lastChar">
- <xsl:value-of select="substring($temp2, string-length($temp2))"/>
- </xsl:variable>
- <xsl:if test="not(contains($prop_EndChars, $lastChar))">
- <xsl:call-template name="templ_prop_Dot"/>
- </xsl:if>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring($format, 1, 1)" />
- <xsl:call-template name="StringFormatDate">
- <xsl:with-param name="format" select="substring($format, 2)" />
- <xsl:with-param name="day" select="$day"/>
- <xsl:with-param name="month" select="$month"/>
- <xsl:with-param name="year" select="$year"/>
- <xsl:with-param name="withDot" select="$withDot" />
- </xsl:call-template>
- <xsl:if test="string-length($format)=1">
- <xsl:if test="withDot = 'yes' and not(contains($prop_EndChars, $format))">
- <xsl:call-template name="templ_prop_Dot"/>
- </xsl:if>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement