xsl-list
[Top] [All Lists]

RE: [xsl] <quote>XSL is NOT easy</quote>

2007-06-26 08:28:00
Once you get it, it IS wonderful.  I have a background in procedural and
object-oriented programming. Making the leap to the XSLT mind set was
HARD - every day.  Eight months into the project I finally get it, in
all its glory, but I am the only one on my team who does.  Trying to
explain issues to my team mates so we can brainstorm solutions has been
next to impossible, because the paradigm is just not the same.

I think part of the problem is that there are wonderful references if
you know what you solution you need, but I haven't seen anything written
that helps professionals translate common programming principles to
XSLT.  Bruce Eckel wrote a great book that helps C programmers use what
they know about C to learn Java / OO principles.  If anyone is planning
a new book, including content such as "if you are used to doing x, use y
in XSLT" would really help.

" actually I find that most of the really bad code is written by
programmers... The people that do these things are not amateurs. (mores
the pity)"

Don't be a hater. :-) We use what we know, until we know better.

"classical sins:
overuse of for-each. "

There is no other way to do this in many programming languages.  Again,
we use what we know, until we know better.

"2. code was littered with stuff like <xsl:if test="count(record) &gt;
0"><xsl:apply-templates select="record"/></xsl:if>"

Checking for nulls and empty strings before trying to use a variable is
mandatory in many languages and a best practice with others.  It's not
surprising that initial efforts to learn XSLT are littered with this.

That said, I've spent the past week re-factoring my early code to remove
for-each and xsl:if's.  When we know better, we do better...


Thanks!
Angela 

-----Original Message-----
From: bryan rasmussen [mailto:rasmussen(_dot_)bryan(_at_)gmail(_dot_)com] 
Sent: Tuesday, June 26, 2007 2:02 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] <quote>XSL is NOT easy</quote>

actually I find that most of the really bad code is written by
programmers.


2. code was littered with stuff like <xsl:if test="count(record) &gt;
0"><xsl:apply-templates select="record"/></xsl:if>

The people that do these things are not amateurs. (mores the pity)

Cheers,
Bryan Rasmussen

On 6/26/07, Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:
XSL is NOT easy if
you want to code professionally in it. It IS easy to use XSL but not

well. ....

I would agree with this entirely. But then, I think it's true of every

other programming language as well. There is an enormous amount of bad

unmaintainable code being written by self-taught amateur programmers, 
in all sorts of languages, and many of them are attracted to languages

like XSLT that look easy at first sight.

Michael Kay
http://www.saxonica.com/


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



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



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