I have a situation where I am trying to match a number of possible paths to a template in the following way:
<xsl:template match="blah">
<xsl:apply-templates select="foo/*/baz" mode="someMode"/>
</xsl:template>
<xsl:template match="*" mode="someMode">
<xsl:if test="current() != 'foo/bar/baz' and
current() ! ='foo/bam/baz'">
<!-- Process here -->
</xsl:if>
</xsl:template>
So as you can see, there can be any number of elements under 'foo' which have the 'baz' element (for example, 'bar', 'bam', 'bal', 'bav', etc.) but I know about only 2 of them, 'bar' and 'bam'. I don't want to process these ones, but the others I do. Unfortunately, the current() method is not returning the path that was matched, so the test always succeeds (even when the path is 'foo/bar/baz' or 'foo/bam/baz'.
How can I retrieve the path that was matched in the if-test?
Please note: I can't have other xsl:template elements that specifically match 'foo/bar/baz' and 'foo/bam/baz', as they are being processed in other places (in other ways).