[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

avoiding recursion

Subject: avoiding recursion
From: Woody <woody@xxxxxxxxxxxxxx>
Date: Sun, 2 Mar 2003 13:35:16 +0000
avoiding recursion
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.