I'm also interested in including stylesheet info in the returned xml
output. I can use the JAXB schemagen task or bat file to generate the
xsd outside of my normal build process but don't know how to dynamically
generate the schema on the server (in the webapp) and get a common URI
for the xsd (like the application.wadl). I'd be interested in seeing
the rest code that actually passes in the URI to your code below...
> /* xslPath is passed in as a URI */
--mark
_______________________________________________
Mark A. Rabick - Software Engineer
Em: mark.rabick_at_ngc.com
> -----Original Message-----
> From: Christopher Piggott [mailto:cpiggott_at_gmail.com]
> Sent: Thursday, March 05, 2009 8:35 AM
> To: users_at_jersey.dev.java.net
> Subject: [Jersey] Marshaling JAXB objects including
> stylesheet information
>
> I'd like to be able to include an xml-stylesheet processing
> instruction in the xml output from my jersey resources. I
> figured out a way to accomplish this whereby I do the
> marshalling myself:
>
> /* xslPath is passed in as a URI */
> w.write("<?xml version=\"1.0\" encoding=\""
> + marshaller.getProperty(Marshaller.JAXB_ENCODING)
> + "\"?>\n");
> w.write("<?xml-stylesheet type=\"text/xsl\""
> + " href=\""
> + xslPath.toASCIIString()
> + "\"?>\n");
> marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
> marshaller.marshal(item, w);
>
> but this is pretty ugly stuff.
>
> Anybody have a better idea?
>
> --Chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
>