net.sf.saxon.trans.UncheckedXPathException: Cannot add a map to an XDM node tree at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:86) at net.sf.saxon.om.SequenceTool.process(SequenceTool.java:502) at net.sf.saxon.expr.TailCallLoop.process(TailCallLoop.java:172) at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:149) at net.sf.saxon.expr.instruct.UserFunction.process(UserFunction.java:683) at net.sf.saxon.expr.UserFunctionCall.process(UserFunctionCall.java:619) at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:149) at net.sf.saxon.query.XQueryExpression.run(XQueryExpression.java:461) at net.sf.saxon.s9api.XQueryEvaluator.run(XQueryEvaluator.java:461) at net.sf.saxon.Query.runQuery(Query.java:971) at net.sf.saxon.Query.doQuery(Query.java:443) at net.sf.saxon.Query.main(Query.java:103) Caused by: net.sf.saxon.trans.XPathException: Cannot add a map to an XDM node tree at net.sf.saxon.event.ComplexContentOutputter.decompose(ComplexContentOutputter.java:851) at net.sf.saxon.event.ComplexContentOutputter.append(ComplexContentOutputter.java:658) at net.sf.saxon.expr.Expression.lambda$process$0(Expression.java:948) at net.sf.saxon.om.SequenceTool.supply(SequenceTool.java:147) at net.sf.saxon.expr.Expression.process(Expression.java:948) at net.sf.saxon.expr.SystemFunctionCall.process(SystemFunctionCall.java:494) at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:149) at net.sf.saxon.expr.instruct.UserFunction.process(UserFunction.java:683) at net.sf.saxon.expr.UserFunctionCall.process(UserFunctionCall.java:619) at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357) at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142) at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:149) at net.sf.saxon.expr.parser.Evaluator$Process.evaluate(Evaluator.java:422) at net.sf.saxon.expr.TailCallLoop.tailCallDifferentFunction(TailCallLoop.java:195) at net.sf.saxon.expr.TailCallLoop.iterate(TailCallLoop.java:111) at com.saxonica.ee.bytecode.ByteCodeCandidate.iterate(ByteCodeCandidate.java:328) at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:93) at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:84) ... 11 more java.lang.RuntimeException: Internal error evaluating template rule at line 63 in module file:/home/mary/SVG/BUGREPORTS/20220809/badframework.xqy at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:162) at net.sf.saxon.expr.instruct.UserFunction.process(UserFunction.java:683) at net.sf.saxon.expr.UserFunctionCall.process(UserFunctionCall.java:619) at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:149) at net.sf.saxon.query.XQueryExpression.run(XQueryExpression.java:461) at net.sf.saxon.s9api.XQueryEvaluator.run(XQueryEvaluator.java:461) at net.sf.saxon.Query.runQuery(Query.java:971) at net.sf.saxon.Query.doQuery(Query.java:443) at net.sf.saxon.Query.main(Query.java:103) Caused by: net.sf.saxon.trans.UncheckedXPathException: Cannot add a map to an XDM node tree at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:86) at net.sf.saxon.om.SequenceTool.process(SequenceTool.java:502) at net.sf.saxon.expr.TailCallLoop.process(TailCallLoop.java:172) at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:149) ... 8 more Caused by: net.sf.saxon.trans.XPathException: Cannot add a map to an XDM node tree at net.sf.saxon.event.ComplexContentOutputter.decompose(ComplexContentOutputter.java:851) at net.sf.saxon.event.ComplexContentOutputter.append(ComplexContentOutputter.java:658) at net.sf.saxon.expr.Expression.lambda$process$0(Expression.java:948) at net.sf.saxon.om.SequenceTool.supply(SequenceTool.java:147) at net.sf.saxon.expr.Expression.process(Expression.java:948) at net.sf.saxon.expr.SystemFunctionCall.process(SystemFunctionCall.java:494) at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:149) at net.sf.saxon.expr.instruct.UserFunction.process(UserFunction.java:683) at net.sf.saxon.expr.UserFunctionCall.process(UserFunctionCall.java:619) at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357) at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142) at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:149) at net.sf.saxon.expr.parser.Evaluator$Process.evaluate(Evaluator.java:422) at net.sf.saxon.expr.TailCallLoop.tailCallDifferentFunction(TailCallLoop.java:195) at net.sf.saxon.expr.TailCallLoop.iterate(TailCallLoop.java:111) at com.saxonica.ee.bytecode.ByteCodeCandidate.iterate(ByteCodeCandidate.java:328) at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:93) at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:84) ... 11 more java.lang.RuntimeException: Internal error evaluating template rule at line 21 in module file:/home/mary/SVG/BUGREPORTS/20220809/fail.xqy at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:162) at net.sf.saxon.query.XQueryExpression.run(XQueryExpression.java:461) at net.sf.saxon.s9api.XQueryEvaluator.run(XQueryEvaluator.java:461) at net.sf.saxon.Query.runQuery(Query.java:971) at net.sf.saxon.Query.doQuery(Query.java:443) at net.sf.saxon.Query.main(Query.java:103) Caused by: java.lang.RuntimeException: Internal error evaluating template rule at line 63 in module file:/home/mary/SVG/BUGREPORTS/20220809/badframework.xqy at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:162) at net.sf.saxon.expr.instruct.UserFunction.process(UserFunction.java:683) at net.sf.saxon.expr.UserFunctionCall.process(UserFunctionCall.java:619) at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:149) ... 5 more Caused by: net.sf.saxon.trans.UncheckedXPathException: Cannot add a map to an XDM node tree at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:86) at net.sf.saxon.om.SequenceTool.process(SequenceTool.java:502) at net.sf.saxon.expr.TailCallLoop.process(TailCallLoop.java:172) at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:149) ... 8 more Caused by: net.sf.saxon.trans.XPathException: Cannot add a map to an XDM node tree at net.sf.saxon.event.ComplexContentOutputter.decompose(ComplexContentOutputter.java:851) at net.sf.saxon.event.ComplexContentOutputter.append(ComplexContentOutputter.java:658) at net.sf.saxon.expr.Expression.lambda$process$0(Expression.java:948) at net.sf.saxon.om.SequenceTool.supply(SequenceTool.java:147) at net.sf.saxon.expr.Expression.process(Expression.java:948) at net.sf.saxon.expr.SystemFunctionCall.process(SystemFunctionCall.java:494) at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:149) at net.sf.saxon.expr.instruct.UserFunction.process(UserFunction.java:683) at net.sf.saxon.expr.UserFunctionCall.process(UserFunctionCall.java:619) at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357) at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142) at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:149) at net.sf.saxon.expr.parser.Evaluator$Process.evaluate(Evaluator.java:422) at net.sf.saxon.expr.TailCallLoop.tailCallDifferentFunction(TailCallLoop.java:195) at net.sf.saxon.expr.TailCallLoop.iterate(TailCallLoop.java:111) at com.saxonica.ee.bytecode.ByteCodeCandidate.iterate(ByteCodeCandidate.java:328) at net.sf.saxon.value.MemoClosure.makeSequence(MemoClosure.java:93) at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:84) ... 11 more Fatal error during query: java.lang.RuntimeException: Internal error evaluating template rule at line 21 in module file:/home/mary/SVG/BUGREPORTS/20220809/fail.xqy