users@jaxb.java.net

Re: JAXB - Automatic creation of mandatory children

From: kr vijay <sagivijay_at_yahoo.com>
Date: Wed, 22 Sep 2004 01:18:28 -0700 (PDT)

Hi,
I think what you are mentioning makes a lot of sense.
As you correctly said, a valid XML is not just limited
to creating the mandatory children.

But all that I understand at the moment is just that
there are other things that should also be taken care
of and that "default" XML fragments need to be
provided.

However, I have absolutely no idea what this looks
like or how exactly I should do this.

This is something I should start working on
immediately for my current project. It would be really
helpful if you can point me to some kind of
tutorial/example/whatever to help me do this.

Your help is greatly appreciated.

Thank you very much,
Vijay

--- Aleksei Valikov <valikov_at_gmx.net> wrote:

> Hi.
>
> >>Could you please elaborate on why are you forced
> to create
> >>all mandatory children.
>
> George Datuashvili wrote:
>
> > One example is use of separator elements for
> schema versioning and
> > extensiblity support. Because of XSD unique
> particle attribution rule
> > such patterns is one of the most reasonable ways
> to deal with version
> > and extensiblity. Then it's annoying and error
> prone if xml/object
> > mapping technology insists on populating all the
> dummy elements by hand,
> > even though it could be done automatically.
> >
> > For more details see use of <bc:delimiter/> on the
> last xml fragment
> > here:
> >
>
http://www.xml.com/pub/a/2004/07/21/design.html?page=3
>
>
> I basically asked about which problem arizes when
> trying to marshall an
> invalid document.
>
> 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
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail:
> users-help_at_jaxb.dev.java.net
>
>



                
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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