This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Wishes for XSL revisions ...


Mark Nahabedian <naha at ai dot mit dot edu> wrote:
[snip]
> Having the ability to pass first class functions around (or at least
> their names) greatly simplifies the programming task by facilitating
> code reuse, as the postings about generic templates will attest.  Less
> code ultimately leads to less debugging and better maintainability.

Agreed and proven by practice.

[snip]

> I find the generic template code somewhat opaque.  It's non-intuitive
> to use an artificially contrived element for match template selection.
> It is more intuitive to dispatch on a template name.  I think that the
> care that is necessary in keeping a separate namespace for such
> element names also exposes the difficulty of exploiting this
> technique.
> 
>From what I've read of his postings, I believe that Dimitre Novatchev,
> who seems to be the inspiration behind generic templates and their
> leading proponent/spokesperson, would prefer to pass template names
> around and that the generic templates technique only uses contrived
> elements rather than template names because that is the only value at
> a call site that can be controlled dynamically.  Dimitre, am I
> understanding you correctly?

Just a clarification -- "proponent" and "spokesperson" are terms from politics. I
have nothing to do with politics, I only put FP patterns to practical use in XSLT.
The forthcoming FP XSLT library will not be anything political -- just practical.

Passing template names around is not exactly what is needed. XSLT and XPath need a
function-reference data type. Now, the first step has been made. The recently
published XSLT 2.0 WD has the long-awaited stylesheet functions -- section 7.3.

The next step will be to provide the means at the language level to declare and use
a ***reference to a function***. Then simply pass this reference to a higher order
function, or return it from a higher-order function.

Being able to use a dynamic value for the template name in xsl:call-template will
not work in the general case, because of the static way name conflicts are resolved
in XSLT. For more information on the possible anomalies have a look at Jeni
Tennison's:

"Reliance on import precedence considered dangerous" 
http://sources.redhat.com/ml/xsl-list/2001-02/msg00996.html, 

and David Carlisle, http://sources.redhat.com/ml/xsl-list/2001-02/msg01003.html).

[snip]

> Should choral music scores be confined to a single octave because we
> don;t all have the range to sing soprano?

My answer to this was to develop my own instrument, not waiting for the gods... And
it is powerful and really works well.

Cheers,
Dimitre Novatchev.





__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]