title: Cannot find external method "..." (must be public) XSLT
body: <p>I'm trying to do some operation on dates using XSL. I found a tutorial on IBM  <a href="http://www.ibm.com/developerworks/library/x-exslt/index.html" rel="nofollow">developerWorks</a> with this script.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xsl:transform
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          xmlns:date="http://exslt.org/dates-and-times"
          version="1.0"
          &gt;
      &lt;xsl:output method="html"/&gt;
  
      &lt;!-- B --&gt;
      &lt;xsl:variable name="now" select="date:date-time()"/&gt;
  
      &lt;xsl:template match="/"&gt;
          &lt;!-- The rest of the Web site HTML material would go here --&gt;
          &lt;xsl:call-template name="date-section"/&gt;
      &lt;/xsl:template&gt;
  
      &lt;xsl:template name="date-section"&gt;
          &lt;p&gt;This page was loaded at &lt;xsl:text/&gt;
              &lt;!-- C --&gt;
              &lt;xsl:value-of select="concat(date:hour-in-day($now), ':',
                                   date:minute-in-hour($now), ':',
                                   date:second-in-minute($now))"/&gt;
              &lt;xsl:text&gt; on &lt;/xsl:text&gt;
              &lt;xsl:value-of select="concat(date:day-in-month($now), ' ',
                                   date:month-name($now), ' ',
                                   date:year($now))"/&gt;
          &lt;/p&gt;
          &lt;p&gt;
              &lt;!-- D --&gt;
              &lt;xsl:variable name="days-elapsed"
                            select="concat('-P',date:day-in-month($now),'D')"/&gt;
              &lt;xsl:variable name="one-month-hence"
                            select="date:add($now, 'P1M')"/&gt;
              &lt;xsl:variable name="next-month-start"
                            select="date:add($one-month-hence, $days-elapsed)"/&gt;
              &lt;xsl:variable name="seconds"
                            select="date:seconds(
                              date:difference($now, $next-month-start)
                           )"/&gt;
              &lt;xsl:text&gt;The next month starts in &lt;/xsl:text&gt;
              &lt;xsl:value-of select="$seconds div (3600*24)"/&gt;
              &lt;xsl:text&gt; days&lt;/xsl:text&gt;
          &lt;/p&gt;
  
      &lt;/xsl:template&gt;
  </code></pre>
  
  <p>I get the following errors:</p>
  
  <pre><code>[ERROR]: Cannot find external method 'com.sun.org.apache.xalan.internal.lib.ExsltDatetime.add' (must be public).
  [ERROR]: Cannot find external method 'com.sun.org.apache.xalan.internal.lib.ExsltDatetime.difference' (must be public).
  [ERROR]: Cannot find external method 'com.sun.org.apache.xalan.internal.lib.ExsltDatetime.seconds' (must be public).
  [ERROR]: Cannot convert data-type 'void' to 'real'.
  [FATAL]: Could not compile stylesheet
  </code></pre>
  
  <p>Any ideas how to fix it. I'm using IntelliJ to run the xsl.</p>
  
  <p>Ultimately I want to to be able to add days to a date. For some reason when I try to use xsl 2 date functions it just tells me they do not exist(And yes I do change the header to version 2 :) ). So I'm trying to make it work with a 3rd party library. The <em>date-time()</em> function from the <em>http://exslt.org/dates-and-times</em> namespace is working but I can't seam to be able to call other functions form that namespace.</p>