Re: [xsl] mode computation case

Subject: Re: [xsl] mode computation case
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 31 Aug 2010 20:14:11 +0100
On 31/08/2010 20:02, ac wrote:
Anyway, these are suggestions, hopefully with some valid justification.
  For now I am handling it with clumsy and bulky redundant xsl:choose
statements, and it works. Mostly, it is not very elegant.

whenever you find a template consists mostly of an xsl:choose then usually the code can be simplified by modifying the match pattern so the various branches are in different templates.


In the example you show, that would mean matching on the @mode parameter, and if that were done you could have different templates for the different cases without needing different modes.

> Not everything is "one shot", on the contrary.

true but if the decision of which shot you are taking is taken dynamically based on the input then usually template matching leads to a more natural modelling of this than using modes (which are best when there is a static choice within the stylesheet)

David

Current Thread