xsl-list
[Top] [All Lists]

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

2007-06-26 00:02:11
actually I find that most of the really bad code is written by programmers.

classical sins:
1. overuse of for-each. The worst ever: match on the root then do a
for each on the document element!! followed by a for-each of every
child of the document element, for-each of each of those etc. it was
for-each all the way down. Matching of attributes using for-each,
comparison of two attributes was done using for-each  down all
attributes until attribute with the name of the to be matched
attribute, save the value of that attribute into a variable, do a
for-each of parent::*/@* until the attribute to be compared with was
found then doing two ifs for if the value matches and if the value
does not match.

I submit that this was the most depraved and perfectly developed
example of a for-each fetish ever discovered in the history of XSL-T.


2.  I once worked with a computer science graduate/programmer, he
didn't just know mainstream languages but also Standard ML and Scheme.
He had been writiing XSL-T for more than a year, and his 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>
--~--