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

<xsl:template match="/">
</xsl:template>

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

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

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
Saxonica

On 10/03/2011 16:54, Philippe.Favrais@continental-corporation.com wrote:
Hello,

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
Philippe
------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help