You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by arun <ar...@gmail.com> on 2013/10/10 15:13:59 UTC

unmarshalling with CDATA in a string element

I have a CDATA section in a string element of an xml message which I am
trying to un-marshal, e.g.

<![CDATA [SOME CDATA]]>

When utilising the JAX-B un-marshalling availible in camel via

	<dataFormats>
		<jaxb filterNonXmlChars="true" prettyPrint="true" contextPath="com.my.dto"
id="myJaxb"/>
	</dataFormats>

	<unmarshal ref="myJaxb"/>


The output appears as character escaped e.g.:

&lt;![CDATA [SOME CDATA]]&gt;

Is there a way to set properties on the un-marshaller used in Camel or any
alternative sollution that I can utilised in Camel to un-marshall my CDATA?




--
View this message in context: http://camel.465427.n5.nabble.com/unmarshalling-with-CDATA-in-a-string-element-tp5741289.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: unmarshalling with CDATA in a string element

Posted by Christian Posta <ch...@gmail.com>.
Maybe take a look at using @XmlValue in your JAXB beans:

http://stackoverflow.com/questions/16684040/jaxb-unmarshalling-cdata-with-html-tags


On Thu, Oct 10, 2013 at 6:13 AM, arun <ar...@gmail.com> wrote:

> I have a CDATA section in a string element of an xml message which I am
> trying to un-marshal, e.g.
>
> <![CDATA [SOME CDATA]]>
>
> When utilising the JAX-B un-marshalling availible in camel via
>
>         <dataFormats>
>                 <jaxb filterNonXmlChars="true" prettyPrint="true"
> contextPath="com.my.dto"
> id="myJaxb"/>
>         </dataFormats>
>
>         <unmarshal ref="myJaxb"/>
>
>
> The output appears as character escaped e.g.:
>
> &lt;![CDATA [SOME CDATA]]&gt;
>
> Is there a way to set properties on the un-marshaller used in Camel or any
> alternative sollution that I can utilised in Camel to un-marshall my CDATA?
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/unmarshalling-with-CDATA-in-a-string-element-tp5741289.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta