I think a feature like this is needed, perhaps implemented as a something
that can be toggled off or on.

> Joe Kathan    
> Medic Computer Systems, LLC
>   <mailto:[EMAIL PROTECTED]>
>   (919)-847-8102 x1862
> Views expressed by the author do not necessarily represent those of Medic
Computer Systems, LLC management and Board of Directors
> 


-----Original Message-----
From: Arnaud Blandin [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 03, 2001 5:31 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] XML mapping question


My mistake I misunderstood your problem...
If requested we can add back this feature if some people find it
useful.

Arnaud

> -----Original Message-----
> From: Arnaud Blandin [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 03, 2001 10:54 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [castor-dev] XML mapping question
>
>
> Hi Joe,
>
> you should set the 'auto-complete' attribute to true in the class element
> of your mapping file.
> For more information you can check the documentation on the web site.
>
> Arnaud
>
> > -----Original Message-----
> > From: Kathan, Joe [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, August 03, 2001 8:23 PM
> > To: [EMAIL PROTECTED]
> > Subject: [castor-dev] XML mapping question
> >
> >
> > Hi
> >
> > I am seeking some advice on how to handle the following situation. To
begin
> > with, lets assume I have created a class as shown:
> >
> > public class Thing {
> >
> >   private int size;
> >
> >   public Thing() {
> >   }
> >
> >   public void setSize(int aSize) {
> >     size = aSize;
> >   }
> >
> >   public int getSize() {
> >     return size;
> >   }
> >
> > }
> >
> > Let's further assume I have this mapping:
> >
> > <?xml version="1.0"?>
> > <!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Object Mapping DTD Version
> > 1.0//EN"
> >                          "http://castor.exolab.org/mapping.dtd";>
> >
> > <mapping>
> >         <class name="Thing">
> >                 <map-to xml="thing"/>
> >                 <field name="size"
> >                        type="integer">
> >                         <bind-xml name="size" node="element"/>
> >                 </field>
> >         </class>
> > </mapping>
> >
> > Lastly, let's assume I have this xml:
> >
> > <?xml version="1.0"?>
> > <thing>
> > <size>100</size>
> > </thing>
> >
> > When I unmarshall and then marsall this, everything works fine...I end
up
> > with a Thing object after unmarshall that has a size of 100, and I end
up
> > with the xml again after marshalling.
> >
> > Now for the problem. One of the strengths of XML is that it allows
> > decoupling the client from the service that fills the request. The
service
> > in our example only cares about the size of something. A developer,
however,
> > working on the next version of the client wants to add the color, say,
to
> > the xml for later use by the service. So they start sending xml like
this:
> >
> > <?xml version="1.0"?>
> > <thing>
> > <color>red</color>
> > <size>100</size>
> > </thing>
> >
> > When I run this new XML with the existing map and class, I now get an
> > exception that the field color is not specified in the map.
Specifically:
> > org.xml.sax.SAXException: unable to find FieldDescriptor for 'color' in
> > ClassDescriptor of thing{file: [not available]; line: 3; column: 8}
> >
> > If I had passed this xml through JOX, the other tool I use, it would
have
> > skipped color and kept on going, making the object as I require. Castor,
by
> > throwing the exception (or more correctly, passing the exception up), is
> > requiring a tight coupling between the xml and the class. How can I
handle
> > this without changing the class in any way and still allowing the client
> > side developer to add tags as they wish? I haven't found a mapping that
> > allows it...and sticking a stylesheet between the client and the service
to
> > filter the color tag out is not an option at this time.
> >
> > Thanks for any suggestions.
> >
> > > Joe Kathan
> > > Medic Computer Systems, LLC
> > >   <mailto:[EMAIL PROTECTED]>
> > >   (919)-847-8102 x1862
> > > Views expressed by the author do not necessarily represent those of
Medic
> > > Computer Systems, LLC management and Board of Directors
> > >
> > >
> >
> > -----------------------------------------------------------
> > If you wish to unsubscribe from this mailing, send mail to
> > [EMAIL PROTECTED] with a subject of:
> >     unsubscribe castor-dev
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to