C#.Net saxon-he-api-220.127.116.11: java.lang.NullPointerException: Null prefix supplied to declareNamespace()
XQueryCompiler xQueryCompiler = processor.NewXQueryCompiler(); xQueryCompiler.DeclareNamespace(_evaluator.RuleNamespace, currentNamespaceURI);
"_evaluator.RuleNamespace" is null , so it throw exception.
Updated by Michael Kay about 2 years ago
The API documentation isn't explicit about what happens when you supply null as the prefix, but it doesn't define any meaning for null, so I think it's a reasonable expectation that null is not an allowed value.
Ideally we should probably be catching Java exceptions and rethrowing them as C# exceptions, but in the general case that would lose stack trace information, so I don't think it would be a particularly beneficial change.
Please register to edit this issue