Re: [xsl] ALWAYS assignment of XSL stylesheets to XML file before aplying them ?

Subject: Re: [xsl] ALWAYS assignment of XSL stylesheets to XML file before aplying them ?
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Wed, 31 Jan 2007 16:11:13 +0000
On 1/31/07, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> Instead most of the tutorials link the XSLT stylesheet at
> first into the XML document:
>
> <?xml version="1.0" encoding="....">
> <?xml-stylesheet type="text/xsl" href="D:\test\myxslt.xsl"?>
> <TOPTAG> ...
> </TOPTAG>
>
> Is there a reason for this ?

It's because the simplest way of running a transformation is to open an XML
file containing such a processing instruction in an XSLT-aware browser. This
means the tutorials can concentrate on teaching you how to write XSLT,
rather than teaching you how to run it in a more realistic production
environment.

True - I think it's counter productive to learn XSLT that way, much better to learn from the beginning that an XSLT processor does the processing and not the browser.

Equally "simplified stylesheets" encourage use of xsl:for-each, which
makes it much harder to grasp templates later on.  Colleagues that
I've taught from from day 1 using templates in full stylesheets have
understood the tree based, recursive descent processing nature of XSLT
and have progressed much more quickly than those that have had to
unlearn things they've assumed when learning the easy way

Current Thread