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

Re: Shorthand.

Subject: Re: Shorthand.
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Thu, 26 Jul 2007 08:47:17 -0700
Re:  Shorthand.
Steve,

The code you provided will greatly benefit from optimization.

Perhaps your employer is interested in achieving faster response time? :o)



--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play



On 7/26/07, Steve <subsume@xxxxxxxxx> wrote:
> If you despise it, why are you using it? In the code you showed, there
> is no reason to use XSLT as all you are doing is using it as a
> procedural language and you can better do that with ASP (which already
> is procedural, whereas xslt is declarative).

I like XSL because it provides a natural division between presentation
and processing logic. I also like it because I find the practice of
outputting HTML with ASP gross. =)

> Good time to upgrade, though: ASP (before .net) is age-old and not
> particularly suited for building web pages anymore, and definitely not
> RIAs (which you seem to build) and MS is planning (or already did?) to
> stop support for it. (but this matter may bring us far off-topic, for
> many it is all a matter of taste anyway).

I've never needed MS support to use ASP. Also, I agree ASP is age-old
but so much of my application is in SQL and XSL, so ASP is really just
a light-weight middle man.

> > 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!
>
> That's good. Lookup a couple of templates from FXSL, it demonstrates
> many techniques, among one the sell-referencing method, where you use
> your own namespace for your own extensions, something along the lines of:
>
> <xsl:stylesheet
>      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>      xmlns:ajax="http://ajax"
>      extension-element-prefixes="ajax"
>      >
>
>     <ajax:link link='Click Me' href='process.asp' />
>
>     <xsl:template match="/">
>        <xsl:copy-of select="document("")/*/ajax:link" />
>     </xsl:template>
>
> </xsl:stylesheet>
>
> will output your ajax link.
>
> But if all you care about is having an LRE, you don't need this
> complexity, nor a call-template, nor apply-templates. Just write it as
> an LRE, period (but here we are, back to the original question I asked
> you: we need to understand your situation better to really help you).

LRE...least restrictive environment?

> > I can't really use apply-templates (a la Grand Mr. Welch) because I'm
> > not transforming links with XSL, I'm generating them.
> Still hoping for a context explanation from you, I haven't seen any
> reason in your code why you need xsl:call-templates. "Generating them"
> says as much to me as it would when you explain what exactly you are
> doing with ASP and you tell me "generating web pages". I am under the
> impression that you are taking the wrong approach and I would like to
> help you with it, but you're not making it easy. Whether you use
> apply-templates or call-template, has nothing to do with 'transforming
> links' either, I wouldn't have a clue of what that could mean (xslt for
> one cannot transform links, it can only transform an input tree of nodes).

I need xsl:call-template because as it stands I have to type out the
anchor tags manually across my site in XSL and I'd rather have a quick
short-hand for outputting them according to a standard format
(template, function, etc).

Here's the top of one of my templates. Does this help?

<xsl:template name="nav">
       <xsl:variable name="id" select="//id" />
       <fieldset id="navigation" class="oneCol">
               <div>
                       <span id="consumerInfo">
                               <xsl:value-of select="//firstName" />&#32;
                               <xsl:value-of select="//MI" />&#32;
                               <xsl:value-of select="//lastName" /> &#32;<br />
                               &#35;<xsl:value-of select="//consumerID" />
                       </span>
                       <span id="menu">
                               <xsl:call-template name="a">
                                       <xsl:with-param name="href" select="concat('id=',$id,'&amp;xsl=basics')" />
                                       <xsl:with-param name="text" select="'Basics'" />
                               </xsl:call-template>&#32; &#124; &#32;
                               <a href="#"
onClick="showData('process.asp?id={$id}&amp;xsl=intake','body');return
false;">Intake</a>&#32; &#124; &#32;
                               <a href="#"
onClick="showData('process.asp?id={$id}&amp;xsl=goals','body');return
false;">Goals and / or <abbr title="Independent Living Plan">I L P
</abbr></a>&#32; &#124; &#32;
                               <a href="#"
onClick="showData('process.asp?id={$id}&amp;xsl=eContacts','body');return
false;">Emergency Contacts</a>
                               &#32; &#124; &#32;
                               <b>
                                       <a href="#"
onClick="showData('process.asp?id={$id}&amp;xsl=contacts','body');return
false;">
                                               <xsl:choose>
                                                       <xsl:when test="//status = '' or //status = 'Open'">
                                                               Contacts
                                                       </xsl:when>
                                                       <xsl:otherwise>
                                                               Contacts
                                                       </xsl:otherwise>
                                               </xsl:choose>
                                       </a>
                               </b>
             --- etc ----

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.