[xsl] avoiding recursion

Subject: [xsl] avoiding recursion
From: Woody <woody@xxxxxxxxxxxxxx>
Date: Sun, 2 Mar 2003 13:35:16 +0000
Hi,

I am converting a series of old msxsl2 scripts to xsl 1.0, or at least rewriting them with the originals as a guidline.

The last script in the one I am working on at the moment is similar to this (in layout)

<xsl:template match="*[@CHGLVL='1'][. != context(-2)] |
                            LIST/ITEM[@CHGLVL='1'][. != context(-3) |
                            PERS/REEQ[@CHGLVL='1'][. != context(-3) |
                            .... and so on for about 20 similar items...    >
    <span class="changed">
        <img class="changebar" src="../images/bar.gif"/>
        <xsl:apply-templates select="."/>
    </span>
</xsl:template>


Its fairly easy to see what it is doing but how can I do a similar thing in xsl 1.0? (ie without the 'context' function)


there are about 20 named sections that it checks so putting that code everywhere else it needs to be would be excessive and obviously without the context() it will just infinitely recurse.

any ideas how I can create the same effect?

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread