Bug #2000
closedFailure with streaming of xsl:iterate
100%
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
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)
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.
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