logo       

RE: Template recursion, StackOverflowError, saxon:while a nd variable assig: msg#00087

text.xml.saxon.help

Subject: RE: Template recursion, StackOverflowError, saxon:while a nd variable assignability

> See also an example of "environment" that contains a set of
> "variables", the values of which can be modified:
>
>
> http://www.mulberrytech.com/Extreme/Proceedings/html/2003/Nova
> tchev01/EML2003Novatchev01.html#t3.6
>

I've just taken the opportunity to re-read this excellent paper.

This style of programming, where updating an environment involves copying
the old environment using xsl:copy-of and appending a new name=value pair,
should benefit greatly from the optimization introduced a couple of releases
ago whereby xsl:copy-of creates a virtual copy of a tree rather than a real
copy. This won't reduce the search time for getting the value of a
particular variable in the store, but it will greatly reduce the copy time
and the use of memory; and for an environment that only contains the
(changing) value of one variable, this is what matters.

The virtual copy is in essence just a pointer to the node that has been
copied. The virtual nodes in the virtual copy are instantiated only when
they are referenced, and themselves consist simply of pointers to the
original nodes: they differ from the original nodes only in that they have
different node identifiers (and thus a different position in document order)
and that axes cannot navigate outside the subtree that was copied. A copy of
a virtual copy is implemented as a virtual copy of the original, to avoid
long chains of indirection.

I would definitely recommend anyone who thinks they need saxon:assign to
take a serious look at this solution.

Michael Kay




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise