OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Bad programmers use recursion, xslt (Offtopic...)

[ Lists Home | Date Index | Thread Index ]
  • To: Michele Vivoda <idmichele@yahoo.it>, xml-dev@lists.xml.org
  • Subject: Re: [xml-dev] Bad programmers use recursion, xslt (Offtopic...)
  • From: Tatu Saloranta <cowtowncoder@yahoo.com>
  • Date: Mon, 27 Mar 2006 12:57:52 -0800 (PST)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=32FJGN1EU58FbSUyAilbeBlBuCh84K7M53DSQSFMhd0AgVxnnAc4J5PlZ/K6Qz5jvm5FFxhyy/ulTB0JT+2x1hjjYuCxOjeinCcyfNnaI7X/2fahWfZI11TSe/TwWlW1G0HTgupZBzADE5rpV1xeKmXKan438hB4rFKcWJ1HGlA= ;
  • In-reply-to: <20060327101200.89390.qmail@web25704.mail.ukl.yahoo.com>

--- Michele Vivoda <idmichele@yahoo.it> 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 




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS