Hi Christian,

Unfortunately, the only way I can think of to do this at present is by using separate in and out bindings, where the values are optional in the input binding but not in the output binding. I realize that's a major inconvenience, since you have to maintain two almost-identical bindings, but it's the best you can do until JiBX 2.0. If you really want to apply this to all optional values, you could use an XSLT transformation to generate the output binding from the input binding - just copy everything except the optional and default attributes of <value> and <format> elements.

 - Dennis

Christian Platta wrote:

Hi everyone,
I have just a simple question: How can I make Jibx to marshall ALL possible XML Tags of a document ? If a value has a default value (e.g. 0 for int) or if a value was not present in the XML document that was unmarshalled, no tag is generated for it during marshalling. I have tried already a lot of things to solve this problem. I ' ve tried to set the default value explicitly by using a format element in the binding file. But still default values are omitted. When I set the default to something like -9999 for int, 0 values are finally marshalled but I think that is not the right way to do this(and wont' work for boolean). I have tried custom serializer and deserializer methods but default values are still not generated. I have also tried to use a test-method that returns always true, but with no avail. Is suppose that there is a very simple way to do this. Can somebody please give me a short answer how to solve this problem for primitive values and objecs?

Christian



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to