In this case, I'm only concerned about unmarshalling. So I assume the problem you describe will not affect my specific case. (?)
> -----Original Message----- > From: Dennis Sosnoski [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 25, 2004 9:37 PM > To: John Crossman > Cc: [EMAIL PROTECTED] > Subject: Re: [jibx-users] Name not allowed for CDATA (why?) > > > Whoops, I just realized this is the problem area that's been > listed on > the status page since beta 3 and is still an issue. The problem with > this is that it'll always marshal as an empty element (even > if the field > value is null). There is a way around this, though, which is > to use a > test-method for the structure that just returns true if the > field value > is non-null. I'll document this in the beta 3a docs (which I'm just > finishing up). > > - Dennis > > John Crossman wrote: > > >Thanks Dennis. That worked. > > > >Is the reason bug-fix on usage="optional" for structures related to > >these scenarios? Or would I have no problem in using: > > > > <structure name="c" usage="optional"> > > <value style="cdata" field="cdataValue" usage="optional"/> > > </structure> > > > >If I need the bug fix, do I need to run a build against > latest source > >in cvs or can I just download the latest zip? > > > >Thanks > > > >J. > > > > > > > > > >> -----Original Message----- > >> From: Dennis Sosnoski [mailto:[EMAIL PROTECTED] > >> Sent: Thursday, March 25, 2004 10:35 AM > >> To: John Crossman > >> Cc: [EMAIL PROTECTED] > >> Subject: Re: [jibx-users] Name not allowed for CDATA (why?) > >> > >> > >> John Crossman wrote: > >> > >> >Can anyone explain why I get this JiBXException (see below)? > >> > > >> >*My XML: > >> >*<e k="dek" t="12"> > >> > <c><![CDATA[<span class="a2"><b > class="dr">update</b></span> The > >> >company plans to use Singingfish technology to improve > its own Web > >> >search engine by letting users look for audio and video > content.^M > >> >]]></c> </e> > >> > > >> >*The binding.xml: > >> >* <mapping name="e" > >> > >class="com.cnetnetworks.framework.data.cache.xpub.PseudoMapEntry" > > >> > <value style="attribute" name="k" field="key" /> > >> > <value style="attribute" name="t" field="type" /> > >> > <value style="element" name="v" field="value" > >> usage="optional" /> > >> > <value style="cdata" name="c" field="cdataValue" > >> usage="optional" /> > >> > </mapping> > >> > > >> >*Error when I try to jibx-bind: > >> >*org.jibx.runtime.JiBXException: Name not allowed for > text or CDATA > >> >value at tag "value"(line 22, col 77, in > >> >/home/johnc/projects/xpub/cvs/java/src/com/cnetnetworks/fram > >> ework/data/cache/xpub/datasource-jibx-binding.xml) > >> > > >> > > >> > > >> You need to use a wrapper for this in the binding, to say > >> that you want > >> this enclosed by an element named "c" (as opposed to just > >> following the > >> "v" element): > >> > >> <structure name="c" usage="optional"> > >> <value style="cdata" field="cdataValue" usage="optional"/> > >> </structure> > >> > >> I think the usage="optional" is required on both the > >> <structure> and the > >> <value> in the current code, though it really shouldn't be > >> necessary on > >> the <value>. Something to go in the new Jira issue > tracking system... > >> > >> - Dennis > >> > >> -- > >> Dennis M. Sosnoski > >> Enterprise Java, XML, and Web Services > >> Training and Consulting > >> http://www.sosnoski.com > >> Redmond, WA 425.885.7197 > >> > >> > >> > >> > > > > > > > > -- > Dennis M. Sosnoski > Enterprise Java, XML, and Web Services > Training and Consulting > http://www.sosnoski.com > Redmond, WA 425.885.7197 > > ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click _______________________________________________ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users
