Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1027 concat() evaluated in push mode

v9.2
closed
Michael Kay
5
2012-10-08
2010-01-02
Michael Kay
No

When a call to concat() forms the body of an XSLT template (typically within xsl:sequence) then it may be evaluated in "push" mode: the idea is that instead of forming the concatenated string and writing that to the serialized output of the transformation, each of the arguments is evaluated and sent to the serializer separately. However, this optimization is only safe when the template results are indeed being serialized, or when they are being used to form the complex content of a constructed element or document node, or the simple content of a node such as an attribute. If the results of the template containing the call to concat() are used in some other way, then instead of a single string being returned, a sequence is returned containing (a) a zero-length string, (b) a sequence of text nodes, one per argument of the concat() call, and (c) another zero-length string.

A patch is being raised to detect at run-time whether the destination of the output is a ComplexContentOutputter, and disable the optimization otherwise. This is not a perfect solution, but it is safe.

Discussion

  • Michael Kay
    Michael Kay
    2010-01-02

    The same problem affects string-join(), so another patch has been committed to cover that case.

     
  • Michael Kay
    Michael Kay
    2010-01-27

    Fixed in 9.2.0.5