Cannot switch to a final result destination while writing a temporary tree

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot switch to a final result destination while writing a temporary tree

Andrew Welch
Hi,

To go with the other similar thread, this stylesheet also produces the error:

"Cannot switch to a final result destination while writing a temporary tree"

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
        <xsl:for-each select="collection('pathtosomexml?select=*.xml;recurse=yes;on-error=ignore')">
                <xsl:for-each select="(1 to 5)">
                        <xsl:result-document href="foo{.}.xml">
                                test <xsl:value-of select="."/>
                        </xsl:result-document>
                </xsl:for-each>
        </xsl:for-each>
</xsl:template>
</xsl:stylesheet>

This seems to work when it isn't wrapped by a collection, or keep the
collection but drop the sequence.  Either way, when used together this
fails.

Using Saxon 8.7

cheers
andrew


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: Cannot switch to a final result destination while writing a temporary tree

Michael Kay
>
> To go with the other similar thread, this stylesheet also
> produces the error:
>
> "Cannot switch to a final result destination while writing a
> temporary tree"

Thanks for this. This one definitely looks wrong. At the very least, it's
the wrong error message (if there's more than one document in the collection
I would expect it to complain about writing two output files with the same
URI). But I suspect the optimizer has done some rewriting which is causing
this problem. (Paradoxically, of course, the whole reason for this
restriction in the language is to define clearly when such rewrites are safe
and when they aren't).

Michael Kay
http://www.saxonica.com/

>
> <xsl:stylesheet version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:template match="/">
> <xsl:for-each
> select="collection('pathtosomexml?select=*.xml;recurse=yes;on-
> error=ignore')">
> <xsl:for-each select="(1 to 5)">
> <xsl:result-document href="foo{.}.xml">
> test <xsl:value-of select="."/>
> </xsl:result-document>
> </xsl:for-each>
> </xsl:for-each>
> </xsl:template>
> </xsl:stylesheet>
>
> This seems to work when it isn't wrapped by a collection, or keep the
> collection but drop the sequence.  Either way, when used together this
> fails.
>
> Using Saxon 8.7
>
> cheers
> andrew
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking
> scripting language
> that extends applications into web and mobile media. Attend
> the live webcast
> and join the prime developer group breaking into this new
> coding territory!
> <a href="http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
> _______________________________________________
> saxon-help mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help