Project

Profile

Help

How to read out in a Serializer the output properties defined in a named xsl:output declaration and applied via xsl:result-document format?

Added by Martin Honnen almost 5 years ago

With the advice given in https://saxonica.plan.io/boards/3/topics/7354 I am able to subclass Serializer to override the getReceiver method (http://saxonica.com/html/documentation/javadoc/net/sf/saxon/s9api/Serializer.html#getReceiver-net.sf.saxon.event.PipelineConfiguration-net.sf.saxon.serialize.SerializationProperties-) and access serialization properties passed in as the second argument when these are defined on the xsl:result-document directly e.g. xsl:result-document method="json".

However, if the result document instruction references a named output declaration with e.g. <xsl:output name="ex1" method="json"/> and xsl:result-document format="ex1" then the method property I try to read out is not set.

Should it be set (documentation says "Serialization parameters originating from the query or stylesheet (for example, xsl:output declarations or xsl:result-document attributes")?

Or is there some other way to find out which output method is applied by a Serializer?


Replies (1)

RE: How to read out in a Serializer the output properties defined in a named xsl:output declaration and applied via xsl:result-document format? - Added by Martin Honnen almost 5 years ago

It seems using

params.getProperties().getProperty("method");

instead of

params.getProperty("method");

gives me the sought output method in any case (i.e. with xsl:output name="json-1" method="json" referenced by xsl:result-document format="json-1" as well as with xsl:result-document method="json").

Is that the intended behaviour? Reading the API I would haved expected getProperty("foo") just to be some shortcut to getProperties().getProperty("foo").

    (1-1/1)

    Please register to reply