Swati-

Just did a quick search through the code, and the UnmarshalHandler
does file a debug message when an extra element is ignored. 
Unfortunately, that is all it does, so there isn't a flag to test for
or anything like that.

Stephen


On 3/24/06, Swati Singhal <[EMAIL PROTECTED]> wrote:
> Thanks...
> But is there any way I can Ignore the undefined
> elements, process the rest of the XML file and at the
> same time get warning or an error which I can catch to
> alert the user ?
>
> --- Keith Visco <[EMAIL PROTECTED]> wrote:
>
> > Swati,
> >
> > Take a look at Unmarshaller#setIgnoreExtraElements.
> >
> >
> http://castor.codehaus.org/xml-faq.html#How-do-I-ignore-elements-during-unmarshalling?
> >
> > Keep in mind however, that this will ignore the
> > element and it's children.
> >
> > --Keith
> >
> >
> > Swati Singhal wrote:
> > > Hi,
> > >
> > > I have an XML file and have written a
> > corresponding
> > > mapping.xml file which works fine.
> > >
> > > We receive these XML files from our customer and
> > > although the format of the XML files is fixed, I
> > > wanted to know what would happen if they send this
> > XML
> > > file with an additional node not defined in my
> > > mappnig.xml?
> > > I tried this and Castor threw an exception saying
> > :
> > >
> > > Exception:unable to find FieldDescriptor for
> > 'PATH' in
> > > ClassDescriptor of ROOT
> > > java.lang.NullPointerException
> > >
> > > saying it didn't find that node in my mapping.xml.
> > >
> > > Is there any way we can make Castor handle such
> > > surprises without affecting unmarshalling of the
> > rest
> > > of the file??
> > >
> > > Thanks,
> > > Swati
> > >
> > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > > http://mail.yahoo.com
> > >
> > > -------------------------------------------------
> > > If you wish to unsubscribe from this list, please
> > > send an empty message to the following address:
> > >
> > > [EMAIL PROTECTED]
> > > -------------------------------------------------
> > >
> > >
> >
> >
> > -------------------------------------------------
> > If you wish to unsubscribe from this list, please
> > send an empty message to the following address:
> >
> > [EMAIL PROTECTED]
> > -------------------------------------------------
> >
> >
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> -------------------------------------------------
> If you wish to unsubscribe from this list, please
> send an empty message to the following address:
>
> [EMAIL PROTECTED]
> -------------------------------------------------
>
>

Reply via email to