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

Subject: RE: [xsl] Reading from and writing to the same URI (XTRE1500)
From: Steven Grossman <sgrssmn@xxxxxxxxx>
Date: Tue, 14 Nov 2006 10:35:30 -0800 (PST)
[colin adams] No it doesn't.  You simply write to a
new file, and then do a delete of the old one, and a
rename of the new one.

I don't want to use an external process.  Are you
suggesting that this is something that can be done
with a standard xslt instruction?

[ronan klyne] please correct me if I'm wrong, but I
see no reason why the parser must
finish reading the input document before starting to
write output.

[michael kay] 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...

I wasn't suggesting a particular implementation.  An
implemetation can choose to do whatever it likes so
long as it can provide reads from unmodified
documents.  An implementation might choose to keep the
result tree in memory, or it might choose to write it
to a temporary file until the transformation

I feel that the specification has the ability to
clearly define the behaviour of reading from and
writing to the same document.  It's a shame to take
away functionality due to an implementation detail -
especially when there are other approaches available.

[michael kay](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.)

I realize this, but it's confusing to anybody writing
or reading the transformation.


Sponsored Link

Talk more and pay less. Vonage can save you up to $300 a year on your phone bill. 
Sign up now.

Current Thread