[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Is it OK for xsl:output to affect the construction of an unserialized result tree?


Subject: RE: [xsl] Is it OK for xsl:output to affect the construction of an unserialized result tree?
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Tue, 20 Jul 2004 11:51:52 -0400

> From: Elliotte Rusty Harold [mailto:elharo@xxxxxxxxxxxxxxx]
> This is a practical issue relating to proposed Xalan-J bug:


> Suppose we transform a DOM Document, XOM document, SAX InputSource or
> some other such representation of an XML document. Furthermore
> suppose that instead of serializing the output as a stream or a
> string we create another DOM document, XOM document, etc. Should the
> xsl:output element have any effect?
>
> My claim is that it should not. Anything said in the xsl:output
> element applies only when the document is serialized to a an actual
> XML document represented as a sequence of characters or bytes, not
> before.

There does seem to be some ambiguity in the xslt 1.0 Rec, because the
meaning of "output" is not quite clear.  The Rec says -

"An XSLT processor may output the result tree as a sequence of bytes,
although it is not required to be able to do so (see [17 Conformance]).
The xsl:output element allows stylesheet authors to specify how they
wish the result tree to be output. If an XSLT processor outputs the
result tree, it should do so as specified by the xsl:output element;
however, it is not required to do so."

So what is the status of a DOM holding the result tree>  Does that
constitute an "output" or not?

There is some language in the conformance section that sheds some light
on this question -

"17 Conformance

A conforming XSLT processor must be able to use a stylesheet to
transform a source tree into a result tree as specified in this
document. A conforming XSLT processor need not be able to output the
result in XML or in any other form.

    NOTE:Vendors of XSLT processors are strongly encouraged to provide a
way to verify that their processor is behaving conformingly by allowing
the result tree to be output as XML or by providing access to the result
tree through a standard API such as the DOM or SAX."

This last NOTE clearly distinguishes between outputting the result tree
on the one hand, and a DOM version of the result tree on the other.

Since xsl:output only applies to "outputting", I think that the
conformance note removes any possible ambiguity.  If so, the new Xalan
behavior is non-conforming.

Cheers,

Tom P


Current Thread
Keywords