Streaming error when xsl:mode and xsl:stream is used

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

Streaming error when xsl:mode and xsl:stream is used

Julian Richter
Hi there

I’m experiencing an issue in Saxon EE 9.7.0.2 when both
<xsl:mode streamable=„yes“/> and <xsl:stream href=„…“> is used.

In know that in this case the xsl:mode Element isn’t needed (and I tried it without it, and it works fine then), but still it worked in Saxon EE 9.7.0.1. So I’m wondering…

The error message in Terminal (OS X 10.11.3) says:
Error
  Requested initial mode  is streamable: must supply a StreamSource or SAXSource
  Requested initial mode  is streamable: must supply a StreamSource or SAXSource

This is what my stylesheet looks like:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:math="http://www.w3.org/2005/xpath-functions/math" exclude-result-prefixes="xs math"
    version="3.0">

    <xsl:output indent="yes"/>

    <xsl:mode streamable="yes" on-no-match="deep-copy"/>

    <xsl:template match="/">
        <Books>
            <xsl:stream href="books_export.xml">
                <xsl:iterate select="Books/Book/copy-of()">
                    <xsl:param name="pages" select="0" as="xs:integer"/>
                    <xsl:on-completion>
                        <xsl:processing-instruction name="Gesamtseitenzahl">
                    <xsl:value-of select="$pages"/>
                </xsl:processing-instruction>
                    </xsl:on-completion>
                    <xsl:variable name="newPages" select="$pages + xs:integer(pages)"/>
                    <Book>
                        <xsl:apply-templates select="node() | @*"/>
                    </Book>
                    <xsl:next-iteration>
                        <xsl:with-param name="pages" select="$newPages"/>
                    </xsl:next-iteration>
                </xsl:iterate>
            </xsl:stream>
        </Books>
    </xsl:template>

</xsl:stylesheet>



Kind regards and thanks for your help in advance,
Julian

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 

signature.asc (859 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Streaming error when xsl:mode and xsl:stream is used

Michael Kay
You're hitting a known bug:

https://saxonica.plan.io/issues/2566

The workaround is to initiate streaming either via the s9api API or using the xsl:stream instruction; it doesn't currently work on the command line. We'll get that fixed in a maintenance release.

Michael Kay
Saxonica


> On 29 Jan 2016, at 11:07, Julian Richter <[hidden email]> wrote:
>
> Hi there
>
> I’m experiencing an issue in Saxon EE 9.7.0.2 when both
> <xsl:mode streamable=„yes“/> and <xsl:stream href=„…“> is used.
>
> In know that in this case the xsl:mode Element isn’t needed (and I tried it without it, and it works fine then), but still it worked in Saxon EE 9.7.0.1. So I’m wondering…
>
> The error message in Terminal (OS X 10.11.3) says:
> Error
>  Requested initial mode  is streamable: must supply a StreamSource or SAXSource
>  Requested initial mode  is streamable: must supply a StreamSource or SAXSource
>
> This is what my stylesheet looks like:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>    xmlns:math="http://www.w3.org/2005/xpath-functions/math" exclude-result-prefixes="xs math"
>    version="3.0">
>
>    <xsl:output indent="yes"/>
>
>    <xsl:mode streamable="yes" on-no-match="deep-copy"/>
>
>    <xsl:template match="/">
>        <Books>
>            <xsl:stream href="books_export.xml">
>                <xsl:iterate select="Books/Book/copy-of()">
>                    <xsl:param name="pages" select="0" as="xs:integer"/>
>                    <xsl:on-completion>
>                        <xsl:processing-instruction name="Gesamtseitenzahl">
>                    <xsl:value-of select="$pages"/>
>                </xsl:processing-instruction>
>                    </xsl:on-completion>
>                    <xsl:variable name="newPages" select="$pages + xs:integer(pages)"/>
>                    <Book>
>                        <xsl:apply-templates select="node() | @*"/>
>                    </Book>
>                    <xsl:next-iteration>
>                        <xsl:with-param name="pages" select="$newPages"/>
>                    </xsl:next-iteration>
>                </xsl:iterate>
>            </xsl:stream>
>        </Books>
>    </xsl:template>
>
> </xsl:stylesheet>
>
>
>
> Kind regards and thanks for your help in advance,
> Julian
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140_______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help



------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help