I want to append value to some attribute in given node that matches a xsl-template
Here is my code. Can someone tell me why is's not working? :)
<xsl:template match="//*[contains(@class,'right-aligned') and @style]">
<xsl:variable name="currentAttributeValue" select="@style"/>
<xsl:attribute name="style">
<xsl:value-of select="concat($currentAttributeValue, 'text-align: right !important;')" />
</xsl:attribute>
</xsl:template>
I've also tried with calling a "helper" template with parameters:
<xsl:template match="//*[contains(@class,'full-width') and @style]">
<xsl:variable name="currentAttributeValue" select="@style"/>
<xsl:call-template name="concat">
<xsl:with-param name="first" select="$currentAttributeValue"/>
<xsl:with-param name="second">width: 100% !important; display: inline-block;</xsl:with-param>
</xsl:call-template>
</xsl:template>
and here is the helper:
<xsl:template name="concat">
<xsl:param name="first" />
<xsl:param name="second" />
<xsl:attribute name="style">
<xsl:value-of select="$first" />
<xsl:value-of select="$second" />
</xsl:attribute>
</xsl:template>
But this is not working either ... Any suggestions?