Jshl server mshaller setproperty XSLT throws PropertyException

I am trying to set the XSL property for my marshaller as follows ( which I copied here ):

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

But this raises a 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 can’t tell in detail that I don’t know what causes this.

+4
source share
1 answer

I managed to find this answer that solved my problem. All I needed to do was to replace the com.sun.xml.bind.xmlHeaders property with com.sun.xml.internal.bind.xmlHeaders .

+3
source

Source: https://habr.com/ru/post/952533/


All Articles