Re: [xslt] non-dynamic modes



I think the moral is that one _does_ end up passing cascading modes down by hand. In practice
it's not that bad. XSLT is so verbose anyway (the COBOL of our times!) that this just seems
reasonable.

If you could do this instead:

  <xsl:apply-templates mode="$thismode"/>

You'd never have to worry about either choose blocks around your apply-templates, OR cascading modes (whether automatically or by hand). I realize this opens up other issues with mode as essentially a select, so I'm not suggesting it's the proper solution.

And although XSLT is verbose, it's not often that you have to duplicate code so long as you're having multiple templates and using apply-templates effectively (one of the reasons I like it). Unfortunately, this is a case where it seems you have to duplicate code to get the desired result, and you're never able to use dynamic mode names, something that would be very useful in web apps.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]