You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ctakes.apache.org by Pei Chen <ch...@apache.org> on 2015/09/21 19:52:50 UTC

XMLSerializer Dynamic Transformer

Hi UIMA Dev,
We have an FHIR based application that requires Saxon XML
Transformations.  However, the
org.apache.uima.util.XMLSerializer:
Line 49:  private static final SAXTransformerFactory
transformerFactory = (SAXTransformerFactory) SAXTransformerFactory
          .newInstance();

Relies on defaulting to
"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl".
i.e. we can't explicitly set the Transformer for UIMA (it's relying on
system wide settings only).

Can we add a method to optionally allow the UIMA XMLSerializer for an
application to dynamically inject or set the Transformer class?  I'll
be happy to supply a patch...

--Pei

Re: XMLSerializer Dynamic Transformer

Posted by Marshall Schor <ms...@schor.com>.
This sound OK to me :-) .

Thank you for offering to contribute a patch, this is much appreciated!

When you design the patch, try to make work in general uses cases, such as:

  - imagine UIMA is being imbedded in a servlet, and there are many different
instances of UIMA, each perhaps with unique pipe lines and classpaths
(implemented by servlet class loaders).

One such approach is to link into the UIMA framework parts which allow
specifying additional options via "maps" of key-value pairs.

Cheers. -Marshall

On 9/21/2015 1:52 PM, Pei Chen wrote:
> Hi UIMA Dev,
> We have an FHIR based application that requires Saxon XML
> Transformations.  However, the
> org.apache.uima.util.XMLSerializer:
> Line 49:  private static final SAXTransformerFactory
> transformerFactory = (SAXTransformerFactory) SAXTransformerFactory
>           .newInstance();
>
> Relies on defaulting to
> "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl".
> i.e. we can't explicitly set the Transformer for UIMA (it's relying on
> system wide settings only).
>
> Can we add a method to optionally allow the UIMA XMLSerializer for an
> application to dynamically inject or set the Transformer class?  I'll
> be happy to supply a patch...
>
> --Pei
>