Jaxb marshaller setproperty XSLT throws PropertyException

匿名 (未验证) 提交于 2019-12-03 00:56:02

问题:

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.

回答1:

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.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!