RE: [xsl] Reading from and writing to the same URI (XTRE1500)

Subject: RE: [xsl] Reading from and writing to the same URI (XTRE1500)
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 14 Nov 2006 18:07:35 -0000
> To preempt the argument that ordering becomes an issue 
> (namely, did the read occur before or after the write), I'll 
> reiterate a sentiment posted in a thread to this forum.  Put 
> a stake in the ground and say that all writes occur at the 
> end of the transformation. 
> All reads see the documents prior to modification.  Is there 
> a flaw in this reasoning that necessitated this restriction? 

This would require an implementation to hold the result tree in memory (it
might be gigabytes) just in case the stylesheet decides to read the old
version of the file. A lot of cost to everyone providing a small benefit to
a few.

(In practice you can generally get around the restriction - at your own risk
- by using two different URIs that refer to the same underlying file.)

Michael Kay

Current Thread