Search

Hi XSLT wizards, wondering if anyone could shed some light on this error I’m getting. I’m trying to use the format-date template (from the date-time.xsl utility) to render dates like “Tuesday, November 30.”

I’m doing this as so:

<xsl:call-template name="format-date">
  <xsl:with-param name="date"><xsl:value-of select="$today"/></xsl:with-param>
  <xsl:with-param name="format">W, M D</xsl:with-param>
</xsl:call-template>

this appears to be theoretically supported but it fails with an error:

XSLTProcessor::transformToXml(): Evaluating variable weekday failed

the error occurs in the date-time.xsl utility, perhaps there is a bug there?

Looks like the XSLT is looking for a @weekday attribute, so it assumes that the date param is an XML node rather than a string. Bug!

Thanks Nick, that’s what I thought. Will log this as an issue (and attempt to fix it tonight.)

I’m thinking…

  • the Date field should output this attribute. Maybe it used to and was subsequently removed?
  • there should be a $weekday param in the pool for cases like your own

Or… the utility makes use of EXSLT, which can might be able to get the current weekday without it being passed from another source.

I had the same issue when using this utility. I suggest you to use Format Date/Time Advanced utility.

Nice, thanks Rainer! I’ll give that a shot.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details