Project

Profile

Help

Bug #2000

closed

Failure with streaming of xsl:iterate

Added by Michael Kay about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Streaming
Sprint/Milestone:
-
Start date:
2014-02-08
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

David Rudel reports on saxon-help list:

I'm having strange results when testing out streaming with xsl:iterate.

My source file looks like this.

<chapter>

    <page>

        <paragraph/>

        <figure/>

        <paragraph/>

    </page>

    <page>

        <paragraph/>

        <paragraph/>

        <paragraph/>

    </page>

</chapter>

When I do an xsl:iterate using:

<xsl:iterate select="descendant::element()[name(.)=('figure','paragraph')]">

I get expected behavior. (note that

and elements are always siblings.

When I instead do this:

<xsl:iterate select="descendant::element()[name(.)=('page','paragraph')]">

Saxon gets lost.

No errors are reported.

I assume the problem is that some elements are children of elements. However, my script does not use any information requiring the content of the elements.

The script is basically:

    <xsl:iterate select="descendant::element()[name(.)=('page','paragraph')]">

        <xsl:text>

        </xsl:text>

        <xsl:value-of select="name(.)"/>

    </xsl:iterate>

I adapted the test as iterate-098 in the XSLT 3.0 test suite. It's working on the 9.6 snapshot but in 9.5 I get different symptoms, namely

java.lang.ClassCastException: net.sf.saxon.expr.XPathContextMinor cannot be cast to net.sf.saxon.expr.XPathContextMajor

at com.saxonica.stream.watch.IterateWatch.endSelectedParentNode(IterateWatch.java:166)

at com.saxonica.stream.watch.WatchManager.endElement(WatchManager.java:369)

at net.sf.saxon.event.StartTagBuffer.endElement(StartTagBuffer.java:274)
Actions #1

Updated by Michael Kay about 10 years ago

I'm surprised by the symptom "no errors were reported"; I'm consistently getting the class cast exception when one node selected by a streaming xsl:iterate is a descendant of another node that was already selected. A patch is being committed on the 9.5 branch; the problem does not exist in the 9.6 branch.

Actions #2

Updated by Michael Kay about 10 years ago

  • Status changed from New to Resolved
Actions #3

Updated by O'Neil Delpratt about 10 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to 9.5.1.5

Bug fix applied in Saxon maintenance release 9.5.1.5

Please register to edit this issue

Also available in: Atom PDF