xsl-list
[Top] [All Lists]

Re: [xsl] A beef with XSLT Sometimes too complicated

2006-07-14 08:28:09
At 05:16 AM 7/14/2006, Nic wrote:
>> Is there a cleaner / simpler way to do this?  Any chance you can do
>> this in one line?
>
> In xslt2:
>
> <xsl:variable name="bg_img" select="if(normalize-space($all_vars))
>  then 'background_bright' else 'background_faded'"/>

I hate the idea of 2 'if's in a language.

IMHO that makes it even more complicated.

In the past it's been asked whether we should prefer our logic in the XPath or in the XSLT, or if in either/both, how to strike the balance.

IIRC it was Dimitre who asked, and Mike gave a characteristically thoughtful answer, but no reliable principle has emerged.

I think we'll be using our aesthetic sense -- what looks right, assessing clarity and concision in the usual way -- until we have enough experience to derive some rules of thumb.

In any case it's going to be fun to see what kind of programming styles emerge in 2.0.

Cheers,
Wendell


--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>