help with xsl:attribute and $root
This is an open discussion with 7 replies, filed under XSLT.
Search
Because $root
is part of the text content in your expression.
Try this:
<xsl:attribute name="style">background-image:url(<xsl:value-of select="$root"/>/workspace/images/article-list-images/<xsl:apply-templates select="article-list-image/item/filename" />);</xsl:attribute>
Of course. Thanks!
Why doesn’t this work?
Adding to what Michael said, curly braces are used to evaluate an expression within an attribute (i.e. between the quotes). Remember that <xsl:attribute>
is an element.
Thanks, Lewis. I was really missing the right words…
FWIW, the curly braces contain ‘attribute value templates’, for your XSL jargon library.
Andrew FTW :-)
‘attribute value templates’
Cool.
Create an account or sign in to comment.
Why doesn’t this work?
{$root} is not evaluated into the current root.