I’m writing xslt code which concatenates some string:
<xsl:attribute name='src'>
<xsl:value-of select="concat('url('', $imgSrc, '')')" />
</xsl:attribute>
For some reason I can’t use it, I keep getting this error:
Unknown function - Name and number of arguments do not match any function signature in the static context - 'http://www.w3.org/2005/xpath-functions:concat'
while evaluating the expression:
select="concat('url('', $imgSrc, '')')"
Any idea?
thx
====================
EDIT
I’m trying to get:
url('some_path')
Was having trouble with the apostrophes, but now it just doesn’t work.
The
'references are resolved by the XML parser that parses your XSLT. Your XSLT processor never sees them. What your XSLT processor sees is:Which is not valid because the commas don’t end up in the right place to separate the arguments. However, this might work for you, depending on the serializer your XSLT processor uses:
This surrounds the arguments in double-quotes, so that your single-quotes do not conflict. The XSLT processor should see this:
Another option is to define a variable:
Which can be used like this:
More here: