Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jaxb marshaller setproperty XSLT throws PropertyException

Tags:

java

xml

jaxb

I try to set XSL property for my marshaller like this (which I copied from here) :

marshaller.setProperty("com.sun.xml.bind.xmlHeaders",
                "<?xml-stylesheet type='text/xsl' href=\"" +
                        xslFileName +
                        "\" ?>");

But it causes javax.xml.bind.PropertyException with this message :

name: com.sun.xml.bind.xmlHeaders value: <?xml-stylesheet type='text/xsl' href="decathlon.xsl" ?>

"very informative"

Sorry, but I cannot elaborate more, frankly I have no idea what causes this.

like image 956
Ben Avatar asked Oct 18 '15 15:10

Ben


1 Answers

I managed to find this answer, which solved my problem. All i had to do to replace the com.sun.xml.bind.xmlHeaders property with com.sun.xml.internal.bind.xmlHeaders.

like image 132
Ben Avatar answered Sep 22 '22 18:09

Ben