Search

Hi guys! How can i set a publish date in attribute datetime.

<time datetime="this value">
 <xsl:call-template name="format-date">
              <xsl:with-param name="date" select="date"/>
              <xsl:with-param name="format" select="'M d, Y'"/>
</xsl:call-template>
</time> 

If your value can be taken as-is from XML then use curly braces so the XPath is evaluated:

<time datetime="{xpath/to-/your/node}">

If you need to get the value of your call-template into the attribute, then use an xsl:attribute element in XSLT:

<time>
    <xsl:attribute name="datetime">
        <xsl:call-template ... />
    </xsl:attribute>
</time>

Oh so simple :-) Thanks so much Nick!

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