-----Original Message-----
From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of Roger Kovack
Sent: 10 January 2003 23:51
To: saxon-help@lists.sourceforge.net
Subject: Re: [saxon] xpath questions

Well, actually, if you do xsl:result-document (or xsl:document) to write an output file, you can actually get away with then reading the file using the document() function. It's technically undefined whether the document() function gets the file in the old state or the new state, but in practice you can get away with it. 

I'm confused here. I though you said that as soon as document() reads a file and builds an internal Saxon DOM, then Saxon assigns that interal DOM to an entry in the namepool. The feature of that is when I refer to that file again with another document() call, Saxon doesn't actually reparse the file but just gives me a reference to the DOM it already built and put in the namepool. If that's the case, then changing the content of that file between document() calls won't actually give me different content on the subsequent document() calls. 
 
Correct. But if you write a document using xsl:result-document before you read it using document(), then you can get the document you have just written, which means that the result of your stylesheet is dependent on order of execution. 
 
Michael Kay