Thanks for the quick response.
I generate a wrapper around the output that also contains
meta-data that is tracked in a database if I persist the data or send it over
the internet. For my immediate needs I can make a name->type
association outside of the XSLT process but would like to know if/how to at
least see what the XSLT stylesheet assigns for the media-type either for
confirmation or for cases where the external mapping is not desirable or
I will look into the sub-classing the SerializerFactory in
the same class as the OutputURIResolver implementation so that I can use my
object-identity Maps to store the info during processing and build it into my
wrapper when I process the close(Result) method.
Let me know if there is any reason my plan wouldn't work or
if you have any thoughts on a better way.
If you look at the code for
net.sf.saxon.instruct.ResultDocument, you will see that it actually calls the
OutputURIResolver before it computes the serialization
I think your best bet might be to subclass
SerializerFactory and register your subclass with the Configuration. In the
SerializerFactory.getReceiver() method you will then have access to both the
Result object that was returned by your OutputURIResolver, and the serialization
properties. You can then discover the media-type property and return
super.getReceiver(). It then depends what you want to do with the media-type -
you can't at this stage substitute a different Result
I can successfully
attach an OutputURIResolver implementation to the Saxon Controller to obtain
the content and the href/base parts of any <xsl:result-document>
elements that I generate in my stylesheet but cannot determine how/where to
access the media-type attribute that is allowed on the element. For the
primary output you can query the output properties with the "media-type" key
via the Controller but it is quite likely that individual result documents
would want to have their own media-types.
I am unsure where
to look as the "Result" interface does not appear to have any fields or a
property map where this could be stored and the Controller appears to pull
only the main document path/output.
My guess is this
is not implemented anywhere, which I understand though would recommend be
considered, but figured I'd ask and see if I can either get confirmation or
have someone point me to the proper location.