[Bug 1319] definition of a XSLT processor

http://www.w3.org/Bugs/Public/show_bug.cgi?id=1319





------- Additional Comments From mike@saxonica.com  2005-05-10 20:30 -------
It's certainly possible to have zero source trees: consider the stylesheet
containing the single template rule

<xsl:template name="main">2</xsl:template>

invoked without specifying a principal source document.

Zero result trees is a bit more questionable. If we change the above template to 

<xsl:template name="main"/>

is there a result tree or not? Section 2.1 is a little ambiguous on this, it
says "a final result tree may also be created implicitly by the initial template
in the absence of an xsl:result-document instruction". This seems to be saying
that the above "may" create a final result tree. In fact, this question isn't
purely academic: in earlier releases the above would cause Saxon to overwrite
the output file with an empty file, whereas in the current release the output
file is untouched (because Saxon doesn't open the output file until it has
something to write to it).

The phrase that appears in the definition of "XSLT Processor" in 2.1 "source
trees into result trees" is deliberately unspecific about how many trees there
are, and I don't think one could get any more general than this. I don't feel a
strong need to change the other phrase ("zero or more") either. I do think we
possibly need a bit more clarity about the circumstances in which a result tree
is constructed implicitly in the absence of xsl:result-document, for example does

<xsl:template match="/">
 <xsl:result-document/>
</xsl:template>

create 0, 1, or 2 result trees?

Michael Kay (personal response)

Received on Tuesday, 10 May 2005 20:30:15 UTC