Hi Ellecer,
I don't see anything wrong in your binding, so I don't know why the
CDATA would not work properly in this case. The one thing that might be
a problem is your style of:
<structure name="DESCRIPTION" usage="optional">
<value style="cdata" get-method="getDESCRIPTION"
usage="optional" />
</structure>
This use of an optional <structure> with no way for the binding compiler
to tell whether it's actually present in the document can cause a lot of
grief, and it's possible this is somehow confusing the CDATA handling
indirectly. Can you try changing this structure to the equivalent (but
simpler):
<value name="DESCRIPTION" style="cdata"
get-method="getDESCRIPTION" usage="optional"/>
and see if that makes a different?
- Dennis
Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
Ellecer Valencia wrote:
> Hi,
>
> I was wondering if there are people in a similar situation who've
> encountered this issue and how they fixed it.
>
> I'm not using Jibx directly.. I'm actually going through spring-oxm
> libraries, using the JibxMarshaller class, which wraps around Jibx,
> but haven't found any bugs in there regarding CDATA.
>
> I've gone through the archives and examples I can find, and it looks
> like my binding file is correct, but I am unable to generate CDATA in
> the elements that I've specified.
>
> Can anyone see if there is something incorrect in this mapping file
> for the fields where it's set with style="cdata"??
>
> <binding direction="output">
> <mapping name="JOB" class="au.com.thiscompany.JOB">
> <structure name="JOB_ID" usage="optional">
> <value style="text" get-method="getJOBID" />
> </structure>
> <structure name="COMP_ID" usage="optional">
> <value style="text" get-method="getCOMPID" />
> </structure>
>
> (SNIP -- all similar fields to above)
>
> <structure name="DESCRIPTION" usage="optional">
> <value style="cdata" get-method="getDESCRIPTION" usage="optional"
> />
> </structure>
> <structure name="JOB_HTML" usage="optional">
> <value style="cdata" get-method="getJOBHTML" usage="optional" />
> </structure>
>
> (SNIP)
>
> <structure name="CATEGORY" usage="optional">
> <value style="text" get-method="getCATEGORY" usage="optional" />
> </structure>
> </mapping>
>
> </binding>
>
>
> DESCRIPTION and JOB_HTML always end up with encoded content instead of
> CDATA. Why?
>
> The original source xml has these field's contents in a CDATA, and
> we're trying to keep it that way in this output xml file.
>
>
> thanks,
>
> Ellecer
>
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak-com
> _______________________________________________
> jibx-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users