getMessageEmitter() returns null

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

getMessageEmitter() returns null

Andrew Welch
Mike,

I'm trying to redirect standard out to my own writer, but doing the
following, returns null on getMessageEmitter().

TransformerHandler handler =
stf.newTransformerHandler(compiledStylesheet);      
((net.sf.saxon.Controller)handler.getTransformer()).getMessageEmitter().setWriter(outputWriter);

The rest of thje code runs fine without that line -  Am I doing it
wrong?  Or is this a special case as I'm using a compiled stylesheet?

(I was trying to implement your suggestion from
http://www.xslt.com/html/xsl-list/2005-08/msg00080.html)


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: getMessageEmitter() returns null

Michael Kay
Try code along these lines:

        Controller controller = (Controller)handler.getTransformer();
        Emitter emitter = controller.getMessageEmitter();
        if (emitter==null) {
            emitter = controller.makeMessageEmitter();
        }

Saxon isn't creating the MessageEmitter until it is first needed.

Michael Kay
Saxonica

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of
> andrew welch
> Sent: 01 November 2005 16:27
> To: [hidden email]
> Subject: [saxon] getMessageEmitter() returns null
>
> Mike,
>
> I'm trying to redirect standard out to my own writer, but doing the
> following, returns null on getMessageEmitter().
>
> TransformerHandler handler =
> stf.newTransformerHandler(compiledStylesheet);      
> ((net.sf.saxon.Controller)handler.getTransformer()).getMessage
> Emitter().setWriter(outputWriter);
>
> The rest of thje code runs fine without that line -  Am I doing it
> wrong?  Or is this a special case as I'm using a compiled stylesheet?
>
> (I was trying to implement your suggestion from
> http://www.xslt.com/html/xsl-list/2005-08/msg00080.html)
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App
> Server. Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> saxon-help mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: getMessageEmitter() returns null

Andrew Welch
> Try code along these lines:
>
>         Controller controller = (Controller)handler.getTransformer();
>         Emitter emitter = controller.getMessageEmitter();
>         if (emitter==null) {
>             emitter = controller.makeMessageEmitter();
>         }
>
> Saxon isn't creating the MessageEmitter until it is first needed.

Ahh ok, thanks.


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help