users@jaxb.java.net

RE: JAXB - Automatic creation of mandatory children

From: George Datuashvili <George.Datuashvili_at_Siebel.com>
Date: Wed, 22 Sep 2004 10:38:27 -0600

I would just like to make sure I get the point across :) Probably if
schema made element mandatory without defaults it means that:

1) Data producer should make some choices before populating them. For
some producer types certain choices can be fixed, so your templating
idea can be quite useful.

2) Or schema author just used the versioning/extensibility pattern
described in the article. In this case there is nothing to choose from.
The dummy mandatory elements are just warts that result since XML Schema
1.0 specification fails to addressing the versioning/extensibility
issues adequately. Even if I don't use templates and produce entire
content programatically, I would still like to never see these warts in
my code. Solution to this is trivial to implement in the xml-object
binding engine itself, like JAXB. Also, wether we like it or not, in
future the use of such pattern will become more common than today.

Thanks
-gia

> -----Original Message-----
> From: Aleksei Valikov [mailto:valikov_at_gmx.net]

<snip>

> Concerning the automatic creation of mandatory children. The
> problem is actually a bit deeper. The truth is that you don't
> need to create mandatory children. Your ultimate goal is a
> valid structure which is not limited to creating the
> mandatory children. You also need correct data fulfilling
> simple type constraints and so on. And in my opinion JAXB
> could not guess those values for you.
>
> My idea to resolve this type of problems would be using some
> kind of "default" XML fragments. I mean, you could create
> defaulting xml fragments per hand and add them to resources.
> These fragment will then be used when creating new objects to
> default their values/children/whatever.
>
> That's a very rough idea. Actually, in my current project I
> have a similar task, but it is scheduled a bit later. I'll
> post my results when I have some.
>
> Bye.
> /lexi


------------------------------------------------------------------------------
This e-mail message is for the sole use of the intended recipient(s) and contains confidential and/or privileged information belonging to Siebel Systems, Inc. or its customers or partners. Any unauthorized review, use, copying, disclosure or distribution of this message is strictly prohibited. If you are not an intended recipient of this message, please contact the sender by reply e-mail and destroy all soft and hard copies of the message and any attachments. Thank you for your cooperation.
====================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net