Below I'm trying to match certain nodes.
<xsl:template match="nodes">
<element>
<xsl:apply-templates select="nodes" mode="different" />
</element>
</xsl:template>
Now, there are multiple ways of processing for the same nodes. I want to use this different way of processing within the current way of processing. That's why I perform apply-templates
on the same selection, which is nodes
, however the mode
is different now.
Here's how the different mode could look like:
<xsl:template match="nodes" mode="different">
<!-- another way of processing these nodes -->
</xsl:template>
Now, this does not work. Only the first type of processing is processed and the apply-templates
call is simply not applied.
To be a bit more specific:
<xsl:template match="Foundation.Core.Association.connection">
<xsl:for-each select="Foundation.Core.AssociationEnd">
<someElement>
<xsl:apply-templates select="Foundation.Core.Association.connection" mode="different" />
</someElement>
</xsl:for-each>
</xsl:template>
As you can see, I select Foundation.Core.Association.connection
. Of course this is wrong, but how do I refer to this element given the current element and position? Given Derek his comment, that should do it.
What am I doing wrong, how can I get what I want using XSLT? What could be another approach to solve this problem?
Thanks.