users@jaxb.java.net

Re: Elements following unexpected elements are ignored

From: Dmitri Colebatch <colebatchd_at_gmail.com>
Date: Tue, 15 Nov 2005 10:14:03 +1100

Hi Gregor,

We have faced a similar situation, and I've simply added and <xsd:any
/> to my schema - jaxb seems to be happy with this, although it may
not be an option for you.

cheers
dim

On 15/11/05, Gregor Koukkoullis <kou_at_gmx.de> wrote:
> Hi...
>
> I'm a happy JAXB since a few years, and I have to thank the team for this
> great work.
>
> Unfortunalty I came across a problem that I cant solve and I hope you can
> help me to find a way to make it work. I'm using Java 1.4 and JAXB 1.0.4
> (also tried the build jaxb-ri-20051113).
>
> I like to read a XML file that contains elements I like to ignore. Main
> reason is that a newer version of the server software contains new elements
> but older client versions dont understand them and should skip and ignore
> these elements.
> I was always receiving a unexpected element error and parsing stopped. I
> searched this mailing list and read that I should implemented a
> ValidationEventHandler that returns true on handleEvent() for this error. I
> did this.
> The result is that this element gets now ignored and parsing continues
> (YES!) but all the following valid and known elements on the same level also
> get ignored and are called to be unexpected (oh no..).
>
> Is there any way I can get it to work to just skip the unknown elements and
> cleanly continue parsing the following known elements.
>
> Thanks,
> Gregor
>
> --
> Telefonieren Sie schon oder sparen Sie noch?
> NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>