Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Eclipse Moxy API - Unmarshaller encoding issue(Eclipse Moxy API - Unmarshaller encoding issue)
Eclipse Moxy API - Unmarshaller encoding issue [message #1708678] Fri, 18 September 2015 15:26 Go to next message
Ananth Krishnan is currently offline Ananth KrishnanFriend
Messages: 2
Registered: September 2015
Junior Member
Hello,

We are using Eclipse Moxy APIs to transform XML to POJO and vice versa. Our message contains 2 standard components: Message Header and Message Body. The Message Body is designed to be of type "Any" in XML (supporting conversion to java Object).

We are facing the following issue during unmarshalling.
The input XML contains characters like ">" which gets converted to ">" character. How do we turn this off? I tried using custom XML Adapter or using Field (or) Attribute transformers. The call back to these classes have data which are already transformed from ">" to ">".
Is there a way to suppress transformation of characters?

Thank you

ananth
Re: Eclipse Moxy API - Unmarshaller encoding issue [message #1708761 is a reply to message #1708678] Sun, 20 September 2015 17:44 Go to previous messageGo to next message
Dmitry Kornilov is currently offline Dmitry KornilovFriend
Messages: 9
Registered: June 2014
Junior Member
Hi,

You should use custom CharacterEscapeHandler.

Take a look on this sample:
http://stackoverflow.com/a/19551693/2893933

Regards,
Dmitry Kornilov
Re: Eclipse Moxy API - Unmarshaller encoding issue [message #1708779 is a reply to message #1708761] Mon, 21 September 2015 05:47 Go to previous message
Ananth Krishnan is currently offline Ananth KrishnanFriend
Messages: 2
Registered: September 2015
Junior Member
Hi Dmitry,

The CharacterEscapeHandler is for marshalling (from Java objects to XML). It will not work for unmarshaller. You cannot assign a CharacterEscapeHandler for unmarshaller as there is no property support for the same. The correct way is to use either Field/Attribute transformers or XML Adapters to receive call back from unmarshaller. As said in my earlier post, the data to these call back listeners are already escaped to > .

- ananth
Previous Topic:Single table inheritance: Using foreign key as discrimination values
Next Topic:JMS Cache Coordination: setDeliveryMode to be non persistent on the TopicPublisher
Goto Forum:
  


Current Time: Thu Apr 25 02:29:40 GMT 2024

Powered by FUDForum. Page generated in 0.02905 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top