"Attribute Value Templates" is here your friend
<p class="time" data-time="{current()/eventTime}">
Duration: <xsl:value-of select="current()/eventTime" /> hour(s)
</p>
In curly brackets, it is indicated that this is an attribute value template, and therefore contains an expression for evaluation.
Note that an alternative way would be to use the xsl: attribute element
<p class="time">
<xsl:attribute name="data-time">
<xsl:value-of select="current()/eventTime" />
</xsl:attribute>
Duration: <xsl:value-of select="current()/eventTime" /> hour(s)
</p>
It is not so elegant. You just need to do it this way if you wanted the name of a dynamic attribute.
Tim c source
share