1

I try to insert current date into my form, but I get an error: "current-date() is an unknown XSLT function".

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" 
xmlns:uf="http://www.xxx.pl" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:fo="http://www.w3.org/1999/XSL/Format" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:msxsl="urn:schemas-microsoft-com:xslt" >
  <xsl:include href="../x/xxx.xslt"/>
  <xsl:include href="../xx/xxxx.xslt"/>
  <xsl:output method="xml" indent="yes" encoding="utf-8"/>
  <xsl:variable name="line-height" select="18"/>
  <xsl:template match="/">
    <fo:root>
      <xsl:call-template name="layout-master-set">
        <xsl:with-param name="margin_TB" select="'0cm'"/>
        <xsl:with-param name="margin_LR" select="'0cm'"/>
        <xsl:with-param name="header_extent" select="'5.25cm'"/>
        <xsl:with-param name="footer_extent" select="'5.25cm'"/>
      </xsl:call-template>
      <fo:page-sequence master-reference="default">
        <fo:flow flow-name="body" line-height="12.0pt" font-family="Trebuchet MS" font-size="10.0pt">
             <fo:block text-align-last="justify">
              <fo:inline font-weight="normal">city, <xsl:value-of select="current-date()"/></fo:inline>
            </fo:block>

Any help?

codelikeprogrammerwoman
  • 1,429
  • 3
  • 14
  • 17
  • 2
    current-date() is an xslt 2.0 function, but it is possible that the xslt processor you are using does not support xslt 2.0. I notice you are referencing the "urn:schemas-microsoft-com:xslt" namespace, which suggests you maybe using Microsoft's MSXML processor, which is indeed xslt 1.0 only. – Tim C Jan 23 '14 at 09:25
  • 1
    If this is the issue, http://stackoverflow.com/questions/7626309/how-to-get-current-date-and-time-in-xslt-1-0 and http://stackoverflow.com/questions/9394322/xslt-1-0-get-current-datetime might be helpful. – Mathias Müller Jan 23 '14 at 09:45
  • Yes, the problem was during parsing code. Thank you Guys! – codelikeprogrammerwoman Jan 23 '14 at 11:28

0 Answers0