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

Re: Porting own template language to xslt

Subject: Re: Porting own template language to xslt
From: "andrew welch" <andrew.j.welch@xxxxxxxxx>
Date: Thu, 16 Mar 2006 12:22:40 +0000
Re:  Porting own template language to xslt
On 3/16/06, Peter Flynn <pflynn@xxxxxx> wrote:
> On Thu, 2006-03-16 at 11:16 +0000, Michael Kay wrote:
> > I think that using xsl:for-each is the natural way to do this.
>
> Interestingly I just had a Prof of CS call me for help (he's learning
> XSLT) and he thought it was completely unnatural -- semantically --
> to use for-each just to switch contexts for a single node; that it
> should be kept for iteration over 1+ nodes.

No, it makes perfect sense once you get it.  Why should the for-each
care whether you select 1 node or 1000?... you are still doing
something "for each" node selected.

Switching variables is a different matter, eg

<xsl:for-each select="$someVar">
  do something
  <xsl:for-each select="$someOtherVar">
    do something else

"for-each" doesn't really fit there, so maybe there's scope for
something there... but usually when I find something in XSLT that I
don't think is quite right, after using it a few times (and perhaps
after a few posts to xsl-list) I realise I was wrong and the design of
XSLT is in fact, genious :)

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.