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

Re: A beef with XSLT Sometimes too complicated

Subject: Re: A beef with XSLT Sometimes too complicated
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 14 Jul 2006 08:49:54 -0700
Re:  A beef with XSLT Sometimes too complicated
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.


While I completely agree with Wendell on this, let me point out that it is not only a matter of aesthetic preference. XSLT is just a little bit more expressive -- one example where I cannot use XPath only is when I need to define a variable as a sequence:

for $i in someSeq

will iterate $i over someSeq

In all such cases one *must* use the <xsl:variable > instruction.



--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.



On 7/14/06, Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> wrote:
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

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.