Bug #3798

.NET API gives "java.lang.UnsupportedOperationException: An array does not have a string value" for XQueryEvaluator.Run method of XQuery returning an array while the Java API with works

Added by Martin Honnen over 3 years ago. Updated about 3 years ago.

Start date:
Due date:
% Done:


Estimated time:
Legacy ID:
Applies to branch:
9.8, trunk
Fix Committed on Branch:
9.8, trunk
Fixed in Maintenance Release:


I experience a difference between the Java and the .NET API when using with an XQuery returning an XDM array, a simple test case in C# is

            Processor processor = new Processor(false);
            XQueryCompiler compiler = processor.NewXQueryCompiler();

            string query = "[[1, 2, 3], [4, 5, 6]]";

            XQueryEvaluator evaluator = compiler.Compile(query).Load();

            Serializer serializer = processor.NewSerializer(Console.Out);


and unfortunately gives an unhandled exception

Unbehandelte Ausnahme: java.lang.UnsupportedOperationException: An array does not have a string value
   bei net.sf.saxon.serialize.UncommittedSerializer.append(Item item, Location locationId, Int32 copyNamespaces)
   bei net.sf.saxon.expr.Expression.process(XPathContext context)
   bei env, Result result, Properties outputProperties)
   bei Saxon.Api.XQueryEvaluator.Run(XmlDestination destination)

(tested with Saxon .NET HE) while the Java transcription

        Processor processor = new Processor(false);
        XQueryCompiler compiler = processor.newXQueryCompiler();

        String query = "[[1, 2, 3], [4, 5, 6]]";

        XQueryEvaluator evaluator = compiler.compile(query).load();

        Serializer serializer = processor.newSerializer(System.out);;

does not give any exception and flattens the array according to the XML output method and outputs

<?xml version="1.0" encoding="UTF-8"?>1 2 3 4 5 6

Is there any reason that the .NET API does not hande this XQuery the same as the Java API?

Does the fix for also fix this .NET issue?


#1 Updated by Michael Kay over 3 years ago

  • Assignee set to O'Neil Delpratt

#2 Updated by O'Neil Delpratt over 3 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
  • Applies to branch 9.8, trunk added
  • Fix Committed on Branch 9.8, trunk added

The fix from #3578 was not complete. Problem is the output properties being overwritten in the Run method of XQueryEvaluator class.

Bug fixed and committed to subversion.

#3 Updated by Debbie Lockett about 3 years ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release added

Bug fix applied in the Saxon maintenance release.

Please register to edit this issue

Also available in: Atom PDF