xsl-list
[Top] [All Lists]

Re: [xsl] Shorthand.

2007-07-25 12:16:04
Oh believe me nobody is more aware of the limitations of XSL 1.0 than
I am. However, I'm not going to move my web application from Classic
ASP to .NET to use Saxon (much as I despise 1.0).

Yeah, my template works perfectly fine but I was just hoping for
something more akin a 1.0 version of Angela's 2.0 solution, for pure
style and type-ability reasons. If I could just magically go:

<xsl:ajaxLink link='Click Me' href='process.asp' />

I'd be thrilled!

I can't really use apply-templates (a la Grand Mr. Welch) because I'm
not transforming links with XSL, I'm generating them.

-S

On 7/25/07, Abel Braaksma <abel(_dot_)online(_at_)xs4all(_dot_)nl> wrote:
One of the drawbacks of using XSLT 1.0 is its verbosity. If you are
using this server side, you can replace your XSLT processor with an XSLT
2.0 compliant one (there's a .NET version of Saxon and Gestalt
available, and a recent mail on this list revealed that the AltovaXML
(free, contains xslt 2.0 compliant processor) can also be called from
.NET apps).

If you can't upgrade for any reason (though only few reasons should
exist against upgrading ;)  and when you locked yourself in with MSXML
anyway, you can use JScript for any functions you would like to create.

Your example does not enlighten what was unclear from your first
examples: why you actually need a named template. The way you show it
above perfectly fits for inlining. It depends on the way you pass the
parameters, or how you organized the rest of your stylesheet whether you
need the verbosity of named templates and/or with-params or not.

On the other side, this *is* the way to create function-like behavior,
but be aware of the pitfall to use it too often and make your stylesheet
look as if you wrote an imperative / procedural program (meaning: in
many occasions, named templates can be replaced by matching templates,
possibly with modes).

The only way to really help you here, is when you show more about the
context how you are using it.

Cheers,
-- Abel Braaksma



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

<Prev in Thread] Current Thread [Next in Thread>