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