[Bug 1264] [XSLT] Reconsider XTDE1480

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





------- Additional Comments From mike@saxonica.com  2005-04-21 19:12 -------
I'm sympathetic to the reuqirement, but I think we need to find a way to do it
cleanly. There are three possible problems if we simply remove the restriction:

(a) the processor might decide that it doesn't need to evaluate the variable,
and the result document then won't be written out.

(b) the processor might decide to evaluate the variable more than once, and the
xsl:result-document instruction will then fail saying two output files with the
same URI have been written

(c) the processor might decide that it only needs to evaluate the variable
partially, for example it might avoid evaluating a subtree that is never
accessed. As with (a) this may cause the result document not to be written, but
in ways that the user will find very hard to debug.

I think a potential solution is to add an attribute
writes-result-document="yes|no" to xsl:variable. If the value is yes, then the
processor is constrained to evaluate the variable as if it were itself a final
result tree (that is, to evaluate it in final output mode), and then assign this
"final result tree" to the variable; it's also constrained to only evaluate the
variable once. It may be tricky to formalize the semantics of this, but it
sounds like a feasible hack.

Michael Kay

Received on Thursday, 21 April 2005 19:12:44 UTC