[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Shorthand.

Subject: Re: Shorthand.
From: Steve <subsume@xxxxxxxxx>
Date: Wed, 25 Jul 2007 15:15:44 -0400
Re:  Shorthand.
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.online@xxxxxxxxx> 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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.