
cazic@gmx.net wrote:
For whitespace-stripping see: http://www.w3.org/TR/xslt#strip
or the XSLT 2.0 spec, which clarifies the intended behaviour much better: http://www.w3.org/TR/xslt20/#stylesheet-stripping
The elimination of xsl:text elements is a Libxslt-only thingy, but it's just an internal processing like pre-compilation of XPath expressions. [snip] So this mechanism relies on a base URI to be known, which is not known if the stylesheet-tree is constructed from an in-memory string.
Ok, I understand that there are certain minor changes in the stylesheet structure, mainly for white-space nodes and xsl:text elements. I personally don't think this is worth storing XML data and copying documents all over the place. Since most people will use document() only to a) find documents in the same directory as the stylesheet (which works anyway) or b) access data in the stylesheet (as opposed to templates, etc.), I can't see why it should hurt anyone to just leave it as it is now. Even the white-space stripping stuff will presumably only show surprising results in very rare cases. So, my preferred solutions is to just let document('') access the stylesheet and "maybe" collect some possible surprising effects somewhere in the documentation. Everything else would be too much overhead in the average case (and for the programmer :). Stefan