Project

Profile

Help

Bug #6431

closed

Issue with SaxonC 12.4.2 command line tool query.exe not outputting error (probably a stack overflow error)

Added by Martin Honnen 7 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Category:
Samples
Start date:
2024-05-20
Due date:
% Done:

0%

Estimated time:
Applies to branch:
Fix Committed on Branch:
12
Fixed in Maintenance Release:
Found in version:
Fixed in version:
12.5
SaxonC Languages:
SaxonC Platforms:
SaxonC Architecture:

Description

I file this issue as https://saxonica.plan.io/boards/4/topics/9656 didn't get any reaction from Saxonica and I now think this is indeed an issue with the command line tool of SaxonC query/query.exe. Used category "Samples" as there doesn't seem to be one for command line tools.

In https://stackoverflow.com/questions/78480047/unbounded-sequence-tail-recursion/78485795#78485795 Dimitre Novatchev posted some code to implement a generator in XPath 3.1, I tested the code with various versions of Saxon (SaxonJ, SaxonCS and SaxonC) and am kind of surprised that SaxonC, when it probably doesn't manage to compute a result due to a stack overflow error, doesn't output any stack trace or at least error message indicating that. Tested with the SaxonC 12.4.2 query.exe command line tool under Windows so far.

A sample XQuery program where you can set the threshold value to try to compute with the generator as a param from the command line is:

declare variable $n as xs:integer external := 1000;

let $put := function($map as map(*), $key as xs:anyAtomicType, $value as item()*) as map(*)
             { Q{http://www.w3.org/2005/xpath-functions/map}put($map, $key, $value) },
     $gen1ToInf :=
       map{
            "initialized": true(),
            "endReached": false(),
            "getCurrent": function($this as map(*)) { $this?last + 1},
            "moveNext":  function($this as map(*))
                         {
                           if(not($this?initialized)) then $put($this, "initialized", true())
                             else $put($this, "last", $this?last +1)
                         },
            "last" : 0 
           },
   $emptyGenerator := function()
   {
       map{
           "initialized" : true(),
           "endReached": true(),
           "getCurrent": function($this as map(*)) {error()},
           "moveNext": function($this as map(*)) {error()}
          }     
   },
   
   $skip-helper := function($gen as map(*), $n as xs:integer, $self as function(*))
   {
       if($n eq 0) then $gen
         else
         (
             let $gen := if(not($gen?initialized)) then $gen?moveNext()
                           else $gen
               return
                 if(not($gen?endReached)) then $self($gen?moveNext($gen), $n -1, $self)
                   else $gen
       )     
   },
   $skip := function($gen as map(*), $n as xs:integer)
   {
      $skip-helper($gen, $n, $skip-helper)
   },
   
   $take-helper := function($gen as map(*), $n as xs:integer, $self as function(*))
   {
    let $gen := if(not($gen?initialized)) then $gen?moveNext()
                        else $gen
        return
           if( $gen?endReached or $n eq 0) then $emptyGenerator()
              else $put($gen, "moveNext", $self($gen?moveNext($gen), $n -1, $self))
   },
   
   $take := function($gen as map(*), $n as xs:integer)
   {
     $take-helper($gen, $n, $take-helper)
   },
   
   $subrange := function($gen as map(*), $m as xs:integer, $n as xs:integer) as map(*)
   {
     $take($skip($gen, $m -1), $n)
   },
   
   $at := function($gen as map(*), $ind as xs:integer)
   {
     let $genResult :=$subrange($gen, $ind, 1)
      return
       $genResult?getCurrent($genResult)
   }
   return
     $at($gen1ToInf, $n)

For me, the default value there of 1000 already gives a lengthy stack trace with SaxonJ I show at the end, SaxonC handles that value fine but seems to have problems at values of n=1460 on Windows and n=13000 on Linux, then all it outputs is e.g. <?xml version="1.0" encoding="UTF-8"?> but no value and no error message or stack trace at all.

I think the query.c command line runner should be improved to output an error message/stack trace.

If I run similar code converted to XSLT 3 through transform/transform.exe it gives a stack trace. Also Python code with SaxonC's Python API gives a stack trace, for details see the linked forum thread.

Saxon HE 12.4 Java stack trace for default value of 1000:

<?xml version="1.0" encoding="UTF-8"?>Exception in thread "main" java.lang.StackOverflowError
        at net.sf.saxon.str.BMPString.equals(BMPString.java:145)
        at net.sf.saxon.ma.trie.ImmutableHashTrieMap$EntryHashNode.get(ImmutableHashTrieMap.java:153)
        at net.sf.saxon.ma.trie.ImmutableHashTrieMap$BranchedArrayHashNode.get(ImmutableHashTrieMap.java:400)
        at net.sf.saxon.ma.trie.ImmutableHashTrieMap.get(ImmutableHashTrieMap.java:45)
        at net.sf.saxon.ma.map.HashTrieMap.addEntry(HashTrieMap.java:297)
        at net.sf.saxon.ma.map.HashTrieMap.addEntry(HashTrieMap.java:29)
        at net.sf.saxon.ma.map.MapFunctionSet$MapPut.call(MapFunctionSet.java:922)
        at net.sf.saxon.ma.map.MapFunctionSet$MapPut.call(MapFunctionSet.java:909)
        at net.sf.saxon.expr.SystemFunctionCall$SystemFunctionCallElaborator.lambda$elaborateForPull$3(SystemFunctionCall.java:625)
        at net.sf.saxon.expr.elab.EagerPullEvaluator.evaluate(EagerPullEvaluator.java:37)
        at net.sf.saxon.expr.elab.LearningEvaluator.evaluate(LearningEvaluator.java:59)
        at net.sf.saxon.expr.instruct.UserFunction.call(UserFunction.java:704)
        at net.sf.saxon.functions.hof.UserFunctionReference$BoundUserFunction.call(UserFunctionReference.java:499)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:356)
        at net.sf.saxon.expr.elab.EagerPullEvaluator.evaluate(EagerPullEvaluator.java:37)
        at net.sf.saxon.expr.instruct.Choose$EagerChooseEvaluator.evaluate(Choose.java:1248)
        at net.sf.saxon.expr.elab.LearningEvaluator.evaluate(LearningEvaluator.java:59)
        at net.sf.saxon.expr.instruct.UserFunction.call(UserFunction.java:704)
        at net.sf.saxon.functions.hof.UserFunctionReference$BoundUserFunction.call(UserFunctionReference.java:499)
        at net.sf.saxon.functions.hof.CurriedFunction.call(CurriedFunction.java:165)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:356)
        at net.sf.saxon.expr.elab.EagerPullEvaluator.evaluate(EagerPullEvaluator.java:37)
        at net.sf.saxon.expr.elab.LearningEvaluator.evaluate(LearningEvaluator.java:59)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:340)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1076)
        at net.sf.saxon.expr.LetExpression$LetExprElaborator.lambda$elaborateForPull$5(LetExpression.java:927)
        at net.sf.saxon.expr.instruct.Choose$ChooseExprElaborator.lambda$elaborateForPull$1(Choose.java:1077)
        at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:85)
        at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:76)
        at net.sf.saxon.om.Sequence.materialize(Sequence.java:62)
        at net.sf.saxon.type.TypeHierarchy.applyFunctionConversionRules(TypeHierarchy.java:95)
        at net.sf.saxon.expr.DynamicFunctionCall$DynamicFunctionCallElaborator.lambda$elaborateForPull$2(DynamicFunctionCall.java:364)
Actions #1

Updated by O'Neil Delpratt 7 months ago

Thanks for reporting the issue. Apologies I did see it but not looked at it yet. I will investigate the issue and report back shortly.

Actions #2

Updated by O'Neil Delpratt 7 months ago

  • Status changed from New to In Progress

I managed to reproduce the reported problem on macos. The query command is not reproducing an error for the stackoverflow.

Actions #3

Updated by O'Neil Delpratt 7 months ago

With the DEBUG flag enabled. When I run the command:

./query -q:example.xq n=1300

I get the output:

Argument = n=1300
<?xml version="1.0" encoding="UTF-8"?>1300
j_run_query status=0% 

Which means no exception was thrown.

However if I run the command:

./query -q:example.xq n=130000

I get the result:

Argument = n=130000
<?xml version="1.0" encoding="UTF-8"?>
j_run_query status=-2%

The -2 Indicates an exception.

In this case, the C application should get the exception thrown in Java and re-throw it. This is a bug against the command-line applications.

Actions #4

Updated by O'Neil Delpratt 7 months ago

  • Status changed from In Progress to Resolved

The exceptionHandler in the SaxonC java code is getting in the way here. This is a case where the exceptionHandler should not be assigned to the command methods.

I have found the problem only in the commands: Query.c and Validate.c.

Bug fixed.

Actions #5

Updated by O'Neil Delpratt 6 months ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 12.5

Bug fix applied in the Saxon 12.5 Maintenance release.

Actions #6

Updated by Community Admin 6 months ago

  • Fix Committed on Branch 12 added

Please register to edit this issue

Also available in: Atom PDF