#1060 Spurious error XTRE1500 (Write and read same document)

Michael Kay
Michael Kay

Saxon may report error XTRE1500 (Cannot read a document that was written during the same transformation) even though no documents are written by the transformation using xsl:result-document. The problem occurs when the document() function is called twice, once with a URL such as file:/a/b/c, (single slash after "file:"), and once with the URL file:///a/b/c (three slashes after "file:").

The code which checks whether a document has already been read treats these two URIs as different, and therefore reads the document twice. However, the code that maintains a list of all URIs that have been read or written (for the purpose of reporting error XTRE1500) treats them as the same, and the second call on document() therefore fails because the URI is already in the list - which Saxon is interpreting as meaning it must have previously been written using xsl:result-document.

A patch is being committed that has the effect of treating these two URIs as equivalent in both situations. It also detects some other equivalences between file: URIs, for example (on the Windows platform) "file:/c:/temp.xml" and "file:/C:/TEMP.XML".


  • Michael Kay
    Michael Kay

    Fixed in