Project

Profile

Help

SXST0060 Component cannot be streamed, although it is guaranteed streamable according to W3C rules. No streamable path found in expression (xsl:value-of, ...)

Added by Martin Honnen over 1 year ago

While experimenting with streaming I have run into an odd message (using Saxon EE 11.4 J):

Error in xsl:for-each/@select on line 15 column 40 of value-of-test3.xsl: SXST0060 Component cannot be streamed, although it is guaranteed streamable according to W3C rules. No streamable path found in expression (xsl:value-of, ...)

The code is

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="3.0"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  exclude-result-prefixes="#all"
  expand-text="yes">

  <xsl:strip-space elements="*"/>

  <xsl:output method="text"/>

  <xsl:mode streamable="yes"/>

  <xsl:template match="/" name="xsl:initial-template">
    <xsl:for-each select="root/record">
      <xsl:value-of select="data(@att1), data(@att2), if (normalize-space(@att3)) then @att3 else 'default'" separator=","/>
      <xsl:text>&#10;</xsl:text>
    </xsl:for-each>
  </xsl:template>
  
</xsl:stylesheet>

XML sample

<root>
  <record att1="a1" att2="b1" att3=""/>
  <record att1="a2" att2="b2" att3="c2"/>
  <record att1="a3" att2="b3" att3="c3"/>
</root>

Is that a Saxon quirk during streamability analysis and/or streamed execution or is that construct really too complicated?

I started with something like <xsl:value-of select="@att1, @att2, if (normalize-space(@att3)) then @att3 else 'default'" separator=","/> and even there I thought with only attribute nodes being used that value-of would be streamable but Saxon rejected it.

Then I tried to simplify the task for Saxon, throwing in data calls but got the above strange message.


Replies (3)

Please register to reply

RE: SXST0060 Component cannot be streamed, although it is guaranteed streamable according to W3C rules. No streamable path found in expression (xsl:value-of, ...) - Added by Martin Honnen over 1 year ago

What I find to work is

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="3.0"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  exclude-result-prefixes="#all"
  expand-text="yes">

  <xsl:strip-space elements="*"/>

  <xsl:output method="text"/>

  <xsl:mode streamable="yes"/>

  <xsl:template match="/" name="xsl:initial-template">
    <xsl:for-each select="root/record">
      <xsl:value-of select="data(@att1), data(@att2), if (normalize-space(data(@att3))) then data(@att3) else 'default'" separator=","/>
      <xsl:text>&#10;</xsl:text>
    </xsl:for-each>
  </xsl:template>
  
</xsl:stylesheet>

RE: SXST0060 Component cannot be streamed, although it is guaranteed streamable according to W3C rules. No streamable path found in expression (xsl:value-of, ...) - Added by Michael Kay over 1 year ago

The message basically means that streamability analysis at compile time was successful, but it then generated an expression tree for which there was no streamable implementation. Which is generally a bug (though there are one or two known cases where I don't know how to fix it, and where I think the streamability rules might be wrong).

    (1-3/3)

    Please register to reply