[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Bad programmers use recursion, xslt (Offtopic...)
--- Michele Vivoda <idmichele@y...> wrote: > > Regarding xslt, what I have always wondered is > whether > > there are many (enough?) cases where having > stateful > > alternative (with real variables or such to store > > state) would have benefits: it seems as if > computing > > certain things just once (or cumulatively) could > yield > > significant improvements. > > Not sure if related but I found in my experience > that sometimes splitting a single XSLT1.0 > transformation > into two transformations could bring good if > not big performance improvements. > > In the first pass you prepare the intermediate > structures you need and and in some way you > add them to the source. > > In the second pass you exploit these pre-prepared > structures saving the effort of calculating > them on the fly (lookup, sort etc). > They are already prepared by you > in the first pass with the flavour you like. Yes, I think it is related. It is another way to solve the problem. I did something similar with conversion from OpenOffice format to DocBook/HTML: one problem with OOo format (wrt xslt processing) is that it is bit tricky (and inefficient) to try to resolve styling in correct way. It is better (for the use case in hand... not necessarily generally) to first flatten style tree, then use flattened styles in the second transformation phase. Also, the pre-processing stage could be shared between different backends. This can also potentially reduce complexity of the solution, solving some O^2 (and up) cases? Also, I think XSL+SAX are nicely suitable for such pipeline processing; although event-based interfaces are pain for other kinds of processing (recursive-descent parsing, data binding), they work well for pipelining, and for creating/serializing tree models (which of course makes sense due to historical background of DOM + XSLT being main driving technologies running on SAX). There used to be lots of activity in coming up with frameworks for glueing transformation pipelines together, too. Perhaps now is time to formalize them, as Michael pointed out? -+ Tatu +- __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
|
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
|