Project

Profile

Help

Bug #5073

closed

C#.Net saxon-he-api-9.9.1.8: java.lang.NullPointerException: Null prefix supplied to declareNamespace()

Added by Dipak Shinde over 3 years ago. Updated over 3 years ago.

Status:
Rejected
Priority:
High
Assignee:
Category:
.NET API
Sprint/Milestone:
Start date:
2021-08-31
Due date:
2021-08-31
% Done:

0%

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

Description

XQueryCompiler xQueryCompiler = processor.NewXQueryCompiler(); xQueryCompiler.DeclareNamespace(_evaluator.RuleNamespace, currentNamespaceURI);

"_evaluator.RuleNamespace" is null , so it throw exception.

Actions #1

Updated by Michael Kay over 3 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.

Actions #2

Updated by Michael Kay over 3 years ago

What are you actually trying to achieve? If you are trying to set the default namespace, the prefix should be a zero-length string, not null, as stated in the API documentation.

Actions #3

Updated by Michael Kay over 3 years ago

  • Status changed from New to Rejected

Closed on the grounds that the product is behaving as designed.

Please register to edit this issue

Also available in: Atom PDF