XML/XSLT stylesheet/day from date

Материал из Web эксперт
Перейти к: навигация, поиск

Get day from date with day-from-date() and current-date()

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <html>
      <body>
        <h3>Date and Time</h3>
        The day of the month is:
        <xsl:value-of select="day-from-date(current-date())" />
        <br />
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
Output:
<html>
   <body>
      <h3>Date and Time</h3>
              The day of the month is:
              10<br></body>
</html>