ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xsl-list
xsl-list
[xsl] Re: RE: Converting attributes to elements and preserving the hierarchy
by Dimitre Novatchev other posts by this author
Dec 19 2001 2:45PM messages near this date
[xsl] Re: document() merge DISTINCT -- a Simple Functional Solution | [xsl] applying templates to an attribute
>  > How do I decide  when to use <xsl:for-each> or a template ?
>  
>  For beginners: always use template rules, until you understand them well
>  enough to know their strengths and weaknesses.
>  
>  For advanced users: use xsl:for-each only when you are absolutely confident
>  that the structure of the source documents handled by your stylesheet is not
>  going to change.
>  
>  Mike Kay

For beginners and advanced users: using a functional programming style and a
functional programming library in XSLT (one is to become available soon) you'll not
need to use xsl:for-each. 

You'll need to use xsl:call-template once per function-library call and you'd have
to use xsl:apply-templates in your higher-order functions (in case you'd be writing
them). However, if syntax-level support for higher order functions is included in
XPath 2.0 and XSLT 2.0, then most probably you'll not even need to use
xsl:call-template and xsl:apply-templates in these cases.

Even in XSLT 1.0 it would become the rule that the standard FP library functions are
"wrapping" these xslt instructions within their code, so that the user can simply
invoke the functions.

As one person put it here, using a FP library will require "less thinking". I would
slightly correct this statement -- it would require another way of thinking in which
the programmer benefits from having the knowledge that solutions to general problems
are pre-coded and re-usable and interconnectable for solving a vast majority of
problems, which in the absence of this pre-coded knowledge would be "unique" and
very difficult (time-consuming) to solve.

Cheers,
Dimitre Novatchev.



__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved