Re: Leventhal's challenge misses the point

Subject: Re: Leventhal's challenge misses the point
From: "Guy Murphy" <guy-murphy@xxxxxxxxxxxxx>
Date: Sat, 29 May 1999 14:57:00 +0100
Hi Miles.

You can do the study for yourself.

Produce the DOM+ECMAScript version of the following...

<xsl:template match="//section/title">
    <h1><xsl:value-of /></h1>
</xsl:template>

Which *might* look like...

var sections = xmlDoc.getElementsByTagName('section');
for (var i = 0; i < sections.length; i++) {
    var titles = sections[i].getElementsByTagName('title');
    for (var j = 0; j < titles.length; j++) {
        document.write('<h1>'+titles[j].nodeValue+'</h1>');
    }
}

[Note: the above script will need to be edited if moved to the server. The
document.write will need to be changed to whatever writing mechanism
supported.]

Now god forbid that we should throw filters into the equation, and all the
condition checking that would bring to the ECMAScript.

Now imagine that you're project manager comes to you after you've produced
all this script and says that she's arranged for tha chaps in dept. X to
have use of the styling, but they want to use it on the server-side, and oh,
they're Unix geeks and want it in Perl, would you be a dear and port it to
Perl for them, or Python, or TCL.

You see Miles, as a Web designer who specialised in DynamicHTML I have used,
do use and will continue to use script. But I don't need to see studies to
know that for this *programmer* XSL is esier for styling than script. On
that basis I can only suppose that a non-programmer may care to just skip
the programming and go straight to the XSL.

XSL take care of the querying, iteration, and recursion for you. It's
template declarations are easier to build up incrimentaly, test, and change.

There are some situations when use of DOM+Script is necessary. I don't
intend to use DOM+Script except when I have to. And I don't have to for
styling.

Others may prefer a different approach, which is cool. I wouldn't insist you
use XSL if you find scripting easier. Michael is trying to insist I use
Script despite my preference.

Cheers

    Guy

----- Original Message -----
From: Miles Sabin <msabin@xxxxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxx>
Cc: Nathan Langley <NLangley@xxxxxxxxxxxxxxxxxxx>
Sent: Friday, May 28, 1999 12:31 PM
Subject: RE: Leventhal's challenge misses the point
[SNIP]

>
> Do you have any evidence to support the claim that non-
> programmer designers will have an easier time with
> declarative languages than with imperative ones? The
> HCI person sitting next to me wants to see the usability
> studies ...
>
> Cheers,
>
>
> Miles
>
[SNIP]


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread