[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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 :)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|