Hi Chris

I just sent you the other email...
May be what you find unnatural about this code is that is's not XML-centric, something similar to using regular expressions for transforming XML :-).

cheers, Sergey

----- Original Message ----- From: "Chris Marshall" <[email protected]>
To: <[email protected]>
Sent: Tuesday, April 07, 2009 12:15 PM
Subject: Re: How to add Stylesheet to XML returned from server?


Hi SergeyTo clarify my earlier post I can achieve the result I want via an
interceptor with the following code:

public void handleMessage(Message message) {
try {
OutputStream os = message.getContent(OutputStream.class);
byte[] b = "<?xml-stylesheet type='text/xsl'
href='foobar.xsl'?>".getBytes();
os.write(b);
message.setContent(OutputStream.class, os);
} catch (IOException ioe) {
ioe.printStackTrace();
}
}

but this rather seems to be missing the point.

Regards Chris


2009/4/7 Chris Marshall <[email protected]>

Thanks - using JAXRSOutInterceptor was part of my experimentation ;-)I am
still battling to find out how to set marshaller properties
programmatically.
My ultimate goal is to set the xsl stylesheet depending on runtime data.
Thanks for your patience.
Regards Chris

2009/4/6 Sergey Beryozkin <[email protected]>

Hi,

JAXRSOutInterceptor is not really memant to be subclassed but then I
should've added 'final' to it :-)
Can you explain please why do you need to modify XML given that the
example works ? If you don't use Spring then marshaller properties can be
set programmatically too - may be it is what you're really after ?

cheers, Sergey



----- Original Message ----- From: "Chris Marshall" <
[email protected]>
To: <[email protected]>
Sent: Monday, April 06, 2009 5:13 PM
Subject: Re: How to add Stylesheet to XML returned from server?



Reply via email to