[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Question on grouping and streaming in XSLT 3: differen

Subject: Question on grouping and streaming in XSLT 3: difference between Saxon 9.6 EE and online version of Exselt
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 17 Jan 2015 10:35:10 -0000
 Question on grouping and streaming in XSLT 3: differen
I am trying to explore the use of streaming with various grouping approaches, mainly with Saxon 9.6 EE, but for comparison I also run examples through the online version of Exselt http://exselt.net/demo.

So far, when I used <xsl:mode streamable="yes"/> to make the whole code use streaming Saxon threw an error on stylesheet compilation if a construct or expression breaking streamability rules was used (for instance "The group-adjacent expression is not motionless").

However with a test case using

group-starting-with="record[foo = 'a']"

Saxon does compile the stylesheet but then gives various warnings during the execution that " SXST0061: An error occurred matching pattern {record[foo = 'a']}: Navigation using child axis is not supported from a streamed input node". and produces a wrong transformation result.

I understand the problem with that pattern and the "foo" child axis access but I wonder whether it should be found as an error during compilation, as in the other examples I tried.

Exselt does run the stylesheet and produces the wanted result but I have no way of seeing whether it built a tree or not.

Here are the samples, the stylesheet is

<xsl:stylesheet version="3.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  exclude-result-prefixes="xs">

<xsl:mode streamable="yes"/>

<xsl:output indent="yes"/>

<xsl:template match="root">
<xsl:copy>
<xsl:for-each-group select="record" group-starting-with="record[foo = 'a']">
<group>
<xsl:copy-of select="current-group()"/>
</group>
</xsl:for-each-group>
</xsl:copy>
</xsl:template>


</xsl:stylesheet>

an input sample is

<root>
  <record>
    <foo>a</foo>
    <bar>1</bar>
  </record>
  <record>
    <foo>b</foo>
    <bar>2</bar>
  </record>
  <record>
    <foo>a</foo>
    <bar>3</bar>
  </record>
  <record>
    <foo>b</foo>
    <bar>4</bar>
  </record>
  <record>
    <foo>a</foo>
    <bar>5</bar>
  </record>
  <record>
    <foo>a</foo>
    <bar>6</bar>
  </record>
  <record>
    <foo>c</foo>
    <bar>7</bar>
  </record>
</root>

the output I want is

<root>
   <group>
      <record>
         <foo>a</foo>
         <bar>1</bar>
      </record>
      <record>
         <foo>b</foo>
         <bar>2</bar>
      </record>
   </group>
   <group>
      <record>
         <foo>a</foo>
         <bar>3</bar>
      </record>
      <record>
         <foo>b</foo>
         <bar>4</bar>
      </record>
   </group>
   <group>
      <record>
         <foo>a</foo>
         <bar>5</bar>
      </record>
   </group>
   <group>
      <record>
         <foo>a</foo>
         <bar>6</bar>
      </record>
      <record>
         <foo>c</foo>
         <bar>7</bar>
      </record>
   </group>
</root>

the one Saxon 9.6 EE gives is

<root>
   <group>
      <record>
         <foo>a</foo>
         <bar>1</bar>
      </record>
      <record>
         <foo>b</foo>
         <bar>2</bar>
      </record>
      <record>
         <foo>a</foo>
         <bar>3</bar>
      </record>
      <record>
         <foo>b</foo>
         <bar>4</bar>
      </record>
      <record>
         <foo>a</foo>
         <bar>5</bar>
      </record>
      <record>
         <foo>a</foo>
         <bar>6</bar>
      </record>
      <record>
         <foo>c</foo>
         <bar>7</bar>
      </record>
   </group>
</root>

but as I said, with various warnings that something went wrong, of the form

Warning: on line 11 of test2015011607.xsl:
SXST0061: An error occurred matching pattern {record[foo = 'a']}: Navigation using child axis is not supported from a streamed input node


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.