Subject: [xsl] Re: Re: character entities From: Dimitre Novatchev <dnovatchev@xxxxxxxxx> Date: Fri, 23 Nov 2001 07:22:23 -0800 (PST) |
> > Also I'd have to go outside XSLT 1.0 (not > > that that necessarily matters) as if the current template goes > > select="../param/constraints" to select all the constraints on sibling > > parameters, then there is _nothing_ a template can do to create that > > node set, as templates don't create nodesets. > > I wonder why Dimitre has not jumped onto this, as that's a prime example > for using generic templates. Write a somewhat general frame for using > recursive templates to collect the nodes you want to have into a node-set > and invoke the desired functionality in the recursive template via the > generic template indirection. (might impress Dimitre too :-) Joerg, I didn't "jump onto this", because generic templates cannot help here -- they create/return RTFs, which even when transformed to a nodeset do not contain the original nodes but their copies. This is how I understand David's text above. What returns the original node-set is either saxon:function, or what will be (judging from the published requirements) xsl:function in XSLT 2.0. And this is not so impressing. What could impress me now will require a few months work to implement -- but I already know it's perfectly possible. And if I have failed with my posts to bring a clear image of the extremely powerful functional programming design patterns that are possible using higher order functions, then this must have been a big waste of time for everybody. Consider the "functional tokenizer" -- this is an implementation of a "stream of characters" -- you supply a template that is simply instantiated whenever a new character "arrives". Isn't this an implementation of "event-driven programming"? The change from a recursive template that calls itself and (among other things) does the useful processing to a template that only gets invoked (by a standard library! piece of code) in response to a particular user-defined event to do only the "useful work" -- this is like changing a self-centered program that specifies all user-interface IO operations sequence to a modern Windows program, that doesn't care who displays what and in what order and what the user did, until "an interesting event" happens that wakes this program into life. Such paradigm was not possible in XSLT before, or am I wrong? And this is only a small example/hint of what will follow when we start following systematically a functional style of XSLT programming. Cheers, Dimitre Novatchev. __________________________________________________ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
AW: [xsl] WG: folder-trouble, Arend Vogtländer | Thread | [xsl] newbie : search an attribute', Laurent Vaills |
Re: [xsl] character entities, David Carlisle | Date | [xsl] newbie : search an attribute', Laurent Vaills |
Month |