RE: Is it OK for xsl:output to affect the construction
> 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
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format