Bug #4141
closed'Serializer' does not contain a constructor that takes 0 arguments
0%
Description
Files
Updated by Michael Kay over 5 years 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.
Updated by Pavel Sekret over 5 years ago
Thank you for your answer, Michael. It's working :)
Updated by Stephan Bussing about 5 years 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?
Updated by O'Neil Delpratt about 5 years ago
Hi, as mentioned in comment #1 the NewSerializer()
method is in the Saxon.Api.Processor
class
Updated by Stephan Bussing about 5 years 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.
Updated by O'Neil Delpratt about 5 years ago
Have you got an older version of Saxon .NET installed or in the GAC?
Updated by Stephan Bussing about 5 years 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