Note that there are some explanatory texts on larger screens.

plurals
  1. POXSLT: Using a different way of processing within the current way of processing
    primarykey
    data
    text
    <p>Below I'm trying to match certain nodes.</p> <pre><code>&lt;xsl:template match="nodes"&gt; &lt;element&gt; &lt;xsl:apply-templates select="nodes" mode="different" /&gt; &lt;/element&gt; &lt;/xsl:template&gt; </code></pre> <p>Now, there are multiple ways of processing for the same nodes. I want to use this different way of processing <strong>within</strong> the current way of processing. That's why I perform <code>apply-templates</code> on the same selection, which is <code>nodes</code>, however the <code>mode</code> is different now.</p> <p>Here's how the different mode could look like:</p> <pre><code> &lt;xsl:template match="nodes" mode="different"&gt; &lt;!-- another way of processing these nodes --&gt; &lt;/xsl:template&gt; </code></pre> <p>Now, this does not work. Only the first type of processing is processed and the <code>apply-templates</code> call is simply not applied.</p> <p>To be a bit more specific:</p> <pre><code>&lt;xsl:template match="Foundation.Core.Association.connection"&gt; &lt;xsl:for-each select="Foundation.Core.AssociationEnd"&gt; &lt;someElement&gt; &lt;xsl:apply-templates select="Foundation.Core.Association.connection" mode="different" /&gt; &lt;/someElement&gt; &lt;/xsl:for-each&gt; &lt;/xsl:template&gt; </code></pre> <p>As you can see, I select <code>Foundation.Core.Association.connection</code>. 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.</p> <p>What am I doing wrong, how can I get what I want using XSLT? What could be another approach to solve this problem?</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload