Re: [xsl] how to avoid losing data when the transformation fails

Subject: Re: [xsl] how to avoid losing data when the transformation fails
From: "Wolfhart Totschnig wolfhart.totschnig@xxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 15 May 2025 18:03:51 -0000
Is that an XSLT problem in that the XSLT processor really reads and writes the same file in a single transformation?

Or should your "script" somehow note that the XSLT failed to produce a normal result and in that case not overwrite the input?

Sorry for not having been clear. The situation is that, when I call Saxon, the source and the output are the same file:


java -cp "/home/wolfhart/Programs/Saxon/saxon9he.jar" net.sf.saxon.Transform -s:biblio.xml -xsl:new_biblio.xsl -o:biblio.xml

So, when new_biblio.xsl fails because of an unforeseen error (often due to external data not having the expected form), I get a truncated or empty biblio.xml.

Current Thread