Project

Profile

Help

Support #5740

closed

Is there any way to get serialization properties from Serializer with SaxonCS?

Added by Martin Honnen over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
.NET API
Sprint/Milestone:
-
Start date:
2022-11-21
Due date:
% Done:

0%

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

Description

With the SaxonJ s9api API, I am able to subclass the Serializer class for the main purpose to override the getReceiver method to read out certain serialization properties e.g. the serialization method:

public class MySerializer extends Serializer {

    private String method;

    public String getMethod() {
        return method;
    }

    private Writer myWriter;

    protected MySerializer(Processor processor) {
        super(processor);
    }

    public Writer getWriter() {
        return myWriter;
    }

    @Override
    public void setOutputWriter(Writer writer) {
        myWriter = writer;
        super.setOutputWriter(writer);
    }

    @Override
    public Receiver getReceiver(PipelineConfiguration pipe, SerializationProperties params) throws SaxonApiException {
        method = params.getProperty("method");
        return super.getReceiver(pipe, params);
    }
}

Now I am wondering how to do the same with SaxonCS but it seems I don't find a way, the C# Saxon.Api.Serializer seems to rely on an internal class Saxon.Hej.s9api.Serializer my C# code can't access to subclass it. There doesn't seem to be any other public property or method on Saxon.Api.Serializer to extract e.g. the serialization method property or other serialization properties in general.

Have I overlooked something?

Or is the design on .NET for SaxonCS more restricted than the Java API (and the previous Saxon .NET API where you also could somehow subclass the Java Serializer/override the getReceiver method)?

Please register to edit this issue

Also available in: Atom PDF