This is a tricky one, but I believe that this stylesheet will write an empty file to the principal output destination:

<xsl:template match="/">

while this one will leave the principal output destination unwritten to:

<xsl:template match="/">
     <xsl:result-document href="abc.xml"/>

If you read the spec carefully enough, you'll see that this is what it seems to be requiring, though I'm having some trouble remembering why.

So the answer is, if you want the principal output file to be untouched, then (a) don't write any nodes to the principal result tree, and (b) create a secondary output file using xsl:result-document.

Michael Kay

On 10/03/2011 16:54, wrote:

I have an xsl which should produce an XML file as output. However in some circumstance i would like this xsl not to produce any output file (even not an empty file).
Is there a way to avoid that my xsl produce an empty xml ?

<?xml version="1.0" encoding="UTF-8"?>

Thank you in advance
------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future.
_______________________________________________ saxon-help mailing list archived at