如何为moxy jaxb设置characterEscapeHandler
我正在尝试为 moxy jaxb 设置自定义 characterEscapeHandler
但出现异常:
javax.xml.bind.PropertyException:名称:com.sun.xml.bind.characterEscapeHandler 值:..
我通过添加 com.sun.xml.bind.characterEscapeHandler 来做到这一点(并且它适用于标准 jaxb) code> 属性到 marshallerProperties
的org.springframework.oxm.jaxb.Jaxb2Marshaller
。
我了解 XmlCdata。但我不希望添加 !Cdata[[..,我只想不要转义字符(不添加 Cdata)。
I'm trying to set custom characterEscapeHandler
for moxy jaxb but getting exception:
javax.xml.bind.PropertyException: name: com.sun.xml.bind.characterEscapeHandler value: ..
I do it (and it works for standart jaxb) by adding com.sun.xml.bind.characterEscapeHandler
property to marshallerProperties
of org.springframework.oxm.jaxb.Jaxb2Marshaller
.
I know about XmlCdata. but i don't want !Cdata[[.. will be added, i just want don't escape characters (without adding Cdata).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们目前正在向 < 添加对 JAXB RI 的
CharacterEscapeHandler
的支持。强>EclipseLink JAXB (MOXy)。您可以使用以下错误跟踪我们的进度:您将能够使用 RI 属性和
CharacterEscapeHandler
类或 MOXy 等效项。此支持将于本周进行检查,EclipseLink 2.4.0 的夜间下载将在以下位置提供:一旦该功能被签入,我将更新我的答案。
We are currently in the process of adding support for the JAXB RI's
CharacterEscapeHandler
to EclipseLink JAXB (MOXy). You can track our progress using the following bug:You will be able to use either the RI property and
CharacterEscapeHandler
class, or the MOXy equivalent. This support will be checked in this week, and a nightly download of EclipseLink 2.4.0 will be available at:I will update my answer once the feature has been checked in.