I have a reasonably complex call to xsl:apply-templates:
<xsl:apply-templates select="columnval[@id
and not(@id='_Name_')
and not(@id='Group')
and not(@id='_Count_')]"/>
The expression is reused in other places like this:
<xsl:apply-templates select="someothernode[@id
and not(@id='_Name_')
and not(@id='Group')
and not(@id='_Count_')]"/>
I want to generalize it somehow, so I can define it once and reuse it elsewhere. However, this doesn't seem to work:
<xsl:variable name="x">@id and not(@id='_Name_') and not(@id='Group') and not(@id='_Count_')</xsl:variable>
<xsl:apply-templates select="columnval[$x]"/>
<xsl:apply-templates select="someothernode[$x]"/>
Is there a better / different way of doing this? All I want is to reuse the xpath expression in multiple different calls to xsl:apply-templates (some of which select from different children).
This is going to be used in a client application, so I can't use any extensions or switch to XSLT 2 unfortunately. :(
Thanks.