|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: every tenth row change bgcolor
At 05:52 AM 6/9/2003, Larry wrote:
Sorry to be picky, but here you mention 'pushing' nodes to a template using <xsl:apply-templates select="foo"/>, I've always regarded that as pulling... is that right? I've always thought the only way you can use 'push' is through a basic <xsl:apply-templates/> where the next node to process is decided by document order, with any select statement (apply-templates or for-each) pulling nodes through (e.g. the nodes to process are decided by the stylesheet). With all respect, I think this discussion indicates how far short of a clean, technical distinction is made by "push/pull". It's a handy distinction to make, but a rough one. If "pull" is apply-templates, and "push" is value-of (a useful indicator, I agree), what about for-each? Pull, I think we'd mostly say -- but from the processing point of view, as we've also observed more than once, there's really hardly a difference between using a for-each and a template in a special mode. If "pull" is when you contrain the order, and "push" is when you let document order proceed (again a useful indicator), what if you use apply-templates with xsl:sort? What makes it worse is that I have heard from experienced technologists who've been working with these kinds of things since well before XSL, XSLT is, itself, just plain pull, since its process is driven by the building of the result tree, not on the processing of the input tree. (In contradistinction to DSSSL, for example, I am told.) Yet in a language when you can let apply-templates select a node's children, in document order, by default, and in which you can leave out entire templates and let a built-in template fire ... the whole thing in its most natural, stripped-down form does look an awful lot like "push". The bottom line is that, while I find the distinction is a very useful one for characterizing differences of approach between different stylesheets, and even when one approach is better than another for a particular problem, nonetheless it's really not the hard-and-fast kind of distinction that you really have to have clear in your mind to make the language work (such as the distinction between a node and a string, or in XSLT 1.0, between a node set and a result tree fragment). When Ken says the apply-templates "pulls" when it does a select, he's really saying little more than that the select chooses particular nodes from the source tree to process. Nowhere in the XSLT Rec is anything said about "push". The word "pull" occurs once, but in a way that doesn't make any explicit distinction from "push" (although it does move from explaining how templates can pull values to describe what we have come to call "pull" stylesheets). Cheers, Wendell
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
|

Cart








