Re: Using apply templates vs using value-of select /for-each
Douglas, As an XSL newbie, I have learned the hard way that you cannot nest xsl:for-each within xsl:template, which works opposite to what I am used to having come to XMl with a perl perspective. xsl:foreach is great if you just need to display a lot of static records with not a whole lot of complex operations being done (ie: something like a corporate phone database). The xsl:apply-templates aproach that you are seeing allows you to perform more intense operations on the xml. I am sure I will not have to describe what I mean here too much...just take an afternoon and play with making links and stuff like that display in a manner which is not trivial, you will soon understand what I mean. I started working with this stuff about a week ago, and I have been concerned only with the IE5 side of it all, although I did play with XT for a few minutes. You are welcome to the xsl,xml that I have been playing with if you want to understand what I mean, just let me know. __ Matthew MacKenzie www.cartnetwork.com Douglas Nehring wrote: > > Yet another question... > Looking at all the examples of XSL I have found/received, I've noticed that > some people use "xsl:value-of select" and/or "xsl:for-each select" while > others use "apply templates". I tried a couple of simple examples myself > and was able to achieve the same results using both methods. > > Is any one way "better" than the another (i.e. better supported by parsers, > etc)? Can you do some things with one that you can't do with the other? > Are there any examples of this? > > If this has been covered in a previous thread, please let me know and I'll > check the archives for it again. > > Regards, > > Doug Nehring > Nortel Networks > MSL-100 Advanced Technology > Richardson, TX > (972) 685-2096, ESN 445-2096 > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
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