xsl-list
[Top] [All Lists]

Re: [xsl] When to use conditional constructions?

2014-03-30 15:52:30
On 30 Mar 2014, at 19:58, Dimitre Novatchev <dnovatchev(_at_)gmail(_dot_)com> 
wrote:

John,

If the conditions can be expressed as mutually exclusive, order doesn't 
matter.

If this isn't possible, simply use the 'priority' attribute on the
templates that implement what corresponds to the <xsl:when> elements,
so that template for the first <xsl:when> has the highest priority,
..., etc.

Thanks Dimitre,

I'm aware of that - and have used that for example in converting CSS to XSLT. 

The real issue is keeping all the relevant cases together, so you don't have to 
go searching all over the place. And for some cases (such as in my 'pagination' 
example) whilst the conditions can be described as mutually exclusive, they are 
really compounds - e.g. is-page-break, will-fit and not(is-page-break), 
not(is-page-break or will-fit) and can-be-broken etc. which are most coherently 
described as a priority sequence of cases.

John
--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--