Project

Profile

Help

Bug #4141

'Serializer' does not contain a constructor that takes 0 arguments

Added by Pavel Sekret about 1 year ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
.NET API
Sprint/Milestone:
Start date:
2019-02-20
Due date:
% Done:

0%

Legacy ID:
Applies to branch:
9.9
Fix Committed on Branch:
Fixed in Maintenance Release:

Description

saxon_api_serializer_bug.png (11.1 KB) Pavel Sekret, 2019-02-20 14:14 saxon_api_serializer_bug.png

History

#1 Updated by Michael Kay about 1 year ago

This was a change that we consciously made in 9.9. The same change was made on the Java side in 9.8. To create a Serializer, please use the factory method Processor.NewSerializer(). We made the change on the Java side because we were getting a lot of problems due to people creating a serializer and not connecting it to a Processor. On the .NET side, the change was necessitated because we have been moving towards the .NET classes in Saxon.Api being a thin veneer over the corresponding classes in the Java s9api package; this helps us to ensure consistency of the two, and to achieve better test coverage.

#2 Updated by Pavel Sekret about 1 year ago

Thank you for your answer, Michael. It's working :)

#3 Updated by Michael Kay about 1 year ago

  • Status changed from New to Closed

#4 Updated by Stephan Bussing 5 months ago

This item is already 7 months old, but I still got this problem. I use Saxon9he-api, and I too get this error and I don't see the NewSerializer() method.

The version I use is 9.9.1.5 in .NET.

What am I missing?

#5 Updated by O'Neil Delpratt 5 months ago

Hi, as mentioned in comment #1 the NewSerializer() method is in the Saxon.Api.Processor class

#6 Updated by Stephan Bussing 5 months ago

Thanks for the reply, but I don't see the NewSerializer() method in the Processor class either. Saxon.Api.Processor.NewSerializer(); throws The type name 'NewSerializer' does not exist in the type 'Processor'. So I clearly do something wrong.

#7 Updated by O'Neil Delpratt 5 months ago

Have you got an older version of Saxon .NET installed or in the GAC?

#8 Updated by Stephan Bussing 5 months ago

Oke, solved. I didn't know it was a static method

Saxon.Api.Processor clsProcessor = new Processor(); var serializer = clsProcessor.NewSerializer();

Thanks for the help

Please register to edit this issue

Also available in: Atom PDF