简体   繁体   English

Jaxb marshaller setproperty XSLT抛出PropertyException

[英]Jaxb marshaller setproperty XSLT throws PropertyException

I try to set XSL property for my marshaller like this ( which I copied from here ) : 我尝试为我的marshaller设置XSL属性( 我从这里复制 ):

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

But it causes javax.xml.bind.PropertyException with this message : 但它会导致带有以下消息的javax.xml.bind.PropertyException

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. 对不起,但我不能详细说明,坦率地说,我不知道是什么导致了这一点。

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 . 我只需要用com.sun.xml.internal.bind.xmlHeaders替换com.sun.xml.bind.xmlHeaders属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM