|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: xsl:for-each vs. xsl:apply-templates
Hello Dimitre and all my long lost pals, > xsl:apply-templates is much richer and deeper than > xsl:for-each, even simply because we don't know what code > will be applied on the nodes of the selection -- in the > general case this code will be different for different nodes > of the node-list. Also, the code that will be applied can be > written way after the xsl:apply templates was written and by > people that do not know the original author. You could make some analogies with OOP polymorphism, in that apply-templates is a polymorphic function. Modes could be compared with method names, and match patterns could be compared (loosely) with subtyping for dynamic function resolution. In fact, if you look at the XML source document as "code" rather than just "data", then you end up with a sort of twice-removed function resolution. A given element in the source may result in executing some code in some template rule(s) somewhere. I've found that this twice-removed nature allows me to express software intentions quite clearly in XML without being bothered at all by implementation details. I suspect that my next step will be to finally wrap my brain around your work on XSLT as a functional language. I seem to be heading in that direction. Thanks, Evan
|
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
|

Cart








