My xsl has a parameter
<xsl:param name="halfPath" select="'halfPath'"/>
I want to use it inside match
<xsl:template match="Element[@at1='value1' and not(@at2='{$halfPath}/another/half/of/the/path')]"/>
But this doesn’t work. I guess a can not use parameters inside ”. How to fix/workaround that?
Well, you could use a conditional instruction inside the template:
You just need to be aware that this template will handle all elements that satisfy the first condition. If you have a different template that handles elements that match the first, but not the second, then use an
<xsl:choose>, and put the other template’s body in the<xsl:otherwise>block.Or, XSLT2 can handle it as is if you can switch to an XSLT2 processor.