[XTDE1480] result-document outside the final result tree: my fault or a lazy evaluation bug?

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

[XTDE1480] result-document outside the final result tree: my fault or a lazy evaluation bug?

Florent Georges
  Hi

  I just got the following error message (after stripped out
the package names and a little reformating):

    XTDE1480: Error in call to extension function
    {DocumentInfo transform(XPathContext,Templates,NodeInfo)
    throws XPathException}:
      Cannot switch to a final result destination while writing
      a temporary tree

  I have the following instructions:

    <xsl:variable name="script.compiled"
                  select="thoth:compile-script($script)"/>

    <xsl:result-document href="{$fo.uri}" method="xml">
      <!-- Below is the number line of the reported error. -->
      <xsl:sequence select="saxon:transform($script.compiled,
                                            doc($image.uri))"/>
    </xsl:result-document>

    <xsl:function name="thoth:compile-script">
      <xsl:param name="script" as="xs:string"/>
      <xsl:variable name="uri"
                    select="thoth:resolve-script($script)"/>
      <xsl:choose>
        <xsl:when test="$lang or $logo">
          <xsl:variable name="doc">
            <xsl:apply-templates select="doc($uri)"
                                 mode="modify.script"/>
          </xsl:variable>
          <!-- Just to debug. -->
          <xsl:result-document href=".debug-out.xsl">
            <xsl:sequence select="$doc"/>
          </xsl:result-document>
          <xsl:sequence
              select="saxon:compile-stylesheet($doc)"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:sequence
              select="saxon:compile-stylesheet(doc($uri))"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:function>

I suspect this to be related to a lazy evaluation bug.  Does
I provide more info here, or do I have to go directly to XSL
List?

  Thanks for your help.

  Regards,

--drkm



















       

       
               
___________________________________________________________________________
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com


-------------------------------------------------------
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!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: [XTDE1480] result-document outside the final result tree: my fault or a lazy evaluation bug?

Michael Kay
The

<xsl:result-document href=".debug-out.xsl">

will certainly give you this error: you can't use xsl:result-document inside
a function (because it would a side-effect of the function call. For
debugging, use xsl:message instead.

I can't tell whether the error is legitimate for the first
xsl:result-document because you haven't shown the context in which it
appears. Try using -T: if the result-document instruction is evaluated when
there's an open xsl:function or xsl:variable on the stack, then XTDE1480 is
the correct result.

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

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of
> Florent Georges
> Sent: 02 March 2006 13:58
> To: Saxon Help SF list
> Subject: [saxon] [XTDE1480] result-document outside the final
> result tree: my fault or a lazy evaluation bug?
>
>   Hi
>
>   I just got the following error message (after stripped out
> the package names and a little reformating):
>
>     XTDE1480: Error in call to extension function
>     {DocumentInfo transform(XPathContext,Templates,NodeInfo)
>     throws XPathException}:
>       Cannot switch to a final result destination while writing
>       a temporary tree
>
>   I have the following instructions:
>
>     <xsl:variable name="script.compiled"
>                   select="thoth:compile-script($script)"/>
>
>     <xsl:result-document href="{$fo.uri}" method="xml">
>       <!-- Below is the number line of the reported error. -->
>       <xsl:sequence select="saxon:transform($script.compiled,
>                                             doc($image.uri))"/>
>     </xsl:result-document>
>
>     <xsl:function name="thoth:compile-script">
>       <xsl:param name="script" as="xs:string"/>
>       <xsl:variable name="uri"
>                     select="thoth:resolve-script($script)"/>
>       <xsl:choose>
>         <xsl:when test="$lang or $logo">
>           <xsl:variable name="doc">
>             <xsl:apply-templates select="doc($uri)"
>                                  mode="modify.script"/>
>           </xsl:variable>
>           <!-- Just to debug. -->
>           <xsl:result-document href=".debug-out.xsl">
>             <xsl:sequence select="$doc"/>
>           </xsl:result-document>
>           <xsl:sequence
>               select="saxon:compile-stylesheet($doc)"/>
>         </xsl:when>
>         <xsl:otherwise>
>           <xsl:sequence
>               select="saxon:compile-stylesheet(doc($uri))"/>
>         </xsl:otherwise>
>       </xsl:choose>
>     </xsl:function>
>
> I suspect this to be related to a lazy evaluation bug.  Does
> I provide more info here, or do I have to go directly to XSL
> List?
>
>   Thanks for your help.
>
>   Regards,
>
> --drkm
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ______________________________________________________________
> _____________
> Nouveau : téléphonez moins cher avec Yahoo! Messenger !
> Découvez les tarifs exceptionnels pour appeler la France et
> l'international.
> Téléchargez sur http://fr.messenger.yahoo.com
>
>
> -------------------------------------------------------
> 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!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&
> dat=121642
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

RE: [XTDE1480] result-document outside the final result tree: my fault or a lazy evaluation bug?

Florent Georges
Michael Kay wrote:

> <xsl:result-document href=".debug-out.xsl">

> will certainly give you this error: you can't use
> xsl:result-document inside a function (because it
> would a side-effect of the function call.

  Ok, I didn't know.  I thought it was because the call was resolved
inside the first xsl:result-document, resulting in having two embedded
xsl:result-document.

  Thanks for the help, and sorry for the noise.

  Regards,

--drkm




















       

       
               
___________________________________________________________________________
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com


-------------------------------------------------------
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!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: [XTDE1480] result-document outside the final result tree: my fault or a lazy evaluation bug?

Florent Georges
In reply to this post by Michael Kay
Michael Kay wrote:

> <xsl:result-document href=".debug-out.xsl">

> will certainly give you this error: you can't use
> xsl:result-document inside a function (because it
> would a side-effect of the function call.

  To be sure I understand: it's because xsl:function always evaluates
its contained sequence constructor in the temporary output state.
Right?

  Regards,

--drkm






















       

       
               
___________________________________________________________________________
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com


-------------------------------------------------------
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!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: [XTDE1480] result-document outside the final result tree: my fault or a lazy evaluation bug?

Michael Kay
>
>   To be sure I understand: it's because xsl:function always evaluates
> its contained sequence constructor in the temporary output state.
> Right?


Yes, that's correct.

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




-------------------------------------------------------
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!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help