Beet wrote:

I have a XML element, 'Worksheet,' which consists entirely of optional
structures.

In my java file, I have a bunch of booleans that denote the existence
of the optional structures. However, after marshalling, I cannot get
JiBX to set these booleans to true if the optional element exists. The default constructor sets these values to false. I tried putting
post-set hooks on the optional elements, but they seem to be ignored. I assume the correct thing to do is to set a post-set on the main
parent, 'Worksheet'. However, I don't know how to check for the
existence of optional sub-elements at that level.


There are several ways you could handle this. One would be to use set-methods for the optional structures, and have the set-methods set the corresponding boolean as well as storing the actual object if the value passed in is non-null. Another would be to do basically the same thing in the post-set method, and look for the values that are associated with the optional elements. If the optional element is not present in the document JiBX will set a null value for the corresponding object.

Does that help, or is there something I'm not understanding about your requirements?

 - Dennis


------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to