Jaxb marshaller setproperty XSLT抛出PropertyException [英] Jaxb marshaller setproperty XSLT throws PropertyException

查看:159
本文介绍了Jaxb marshaller setproperty XSLT抛出PropertyException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试为我的marshaller设置XSL属性(我复制了从这里):

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 +
                        "\" ?>");

但它导致 javax.xml.bind.PropertyException 带有以下消息:

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" ?>

信息丰富

抱歉,但是我不能详细说明,坦率地说我不知道​​是什么导致了这一点。

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

推荐答案

我设法找到了这个answer ,这解决了我的问题问题。我只需要用 com.sun.xml.internal.bind.xmlHeaders <替换 com.sun.xml.bind.xmlHeaders 属性/ code>。

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.

这篇关于Jaxb marshaller setproperty XSLT抛出PropertyException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆