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)

Please register to edit this issue

Also available in: Atom PDF