I have been playing with the XmlHeader, a few notes for the archive.
1) Had to checkout and build my own SNAPSHOT, doesn't look as if artifact
was deployed.
2) Works in MSIE, Firefox and Chrome > 11.0.696.3 dev.
3) text/css is applied perfectly as expected, making it easy to style
elements/attributes.
4) text/xsl can be used to provide a generic pretty printing complete with
followable links etc. [
http://img850.imageshack.us/f/screenshotet.png/]
So supplying rendering transformations seems like a neat browser independent
way to consistently aide in human debugging and consumption of resources.
Thanks again!
/Casper
On Thu, Mar 10, 2011 at 9:30 PM, Martin Matula <martin.matula_at_oracle.com>wrote:
> Hi Casper,
>
>
> On 9.3.2011 21:21, Casper Bang wrote:
>
>> I was wondering if there wasn't a way for me to associate a stylesheet
>> with XML output generated by JAXB, such that browsers won't complain and
>> would render things more pleasantly (i.e. underline links and make i easy to
>> explore/navigate a resource graph). I've come across some interesting stuff
>> in the jboss docs, hinting at an XmlHeader annotation:
>> http://docs.jboss.org/resteasy/docs/1.1.GA/userguide/html/Built_in_JAXB_providers.html
>>
> That's a nice feature - we should look into adding that to Jersey. Can you
> please file a feature request?
>
> However, it is not to be found in JAXB nor supplemented by Jersey. In
>> another thread Paul outlines a manual way to do it:
>>
>> http://jersey.576304.n2.nabble.com/Marshaling-JAXB-objects-including-stylesheet-information-td2429726.html
>>
>> I am curious, is there really no other way to do it?
>>
> I am not aware of any.
> Martin
>
>