Hello,

I'm currently evaluating saxon (SaxonEE9-4-0-3J) streaming features with XQuery.

I have create the following query:

********************************************
<result>
{

let $res := for $file in doc('files.xml')//file
return
    saxon:stream(doc($file)//dmCode)[1]

return $res
}
</result>

********************************************

Where files.xml contains files to be parsed and the purpose of "saxon:stream(doc($file)//dmCode)[1]" is to return the first dmCode and stop the streaming.

But Saxon throws me the following Exception [1]

Do I something wrong ?

Thanks for your help!

Nicolas



[1]
java.lang.UnsupportedOperationException: StreamingCopy.copy()
        at com.saxonica.stream.StreamingCopy.copy(StreamingCopy.java:130)
        at net.sf.saxon.expr.FirstItemExpression.copy(FirstItemExpression.java:47)
        at net.sf.saxon.expr.ForExpression.copy(ForExpression.java:575)
        at net.sf.saxon.expr.flwor.FLWORExpression.optimize(FLWORExpression.java:534)
        at net.sf.saxon.expr.parser.ExpressionVisitor.optimize(ExpressionVisitor.java:251)
        at net.sf.saxon.expr.instruct.ParentNodeConstructor.optimize(ParentNodeConstructor.java:224)
        at net.sf.saxon.expr.instruct.FixedElement.optimize(FixedElement.java:92)
        at net.sf.saxon.query.XQueryExpression.<init>(XQueryExpression.java:82)
        at net.sf.saxon.query.QueryParser.makeXQueryExpression(QueryParser.java:155)
        at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:536)
        at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:598)
        at net.sf.saxon.Query.compileQuery(Query.java:719)
        at net.sf.saxon.Query.doQuery(Query.java:313)
        at net.sf.saxon.Query.main(Query.java:97)
Fatal error during query: java.lang.UnsupportedOperationException: StreamingCopy.copy()
--