users@jaxb.java.net

Re: Ignoring Namespace URI on Unmarshalling

From: Chad Boyd <hoverlover_at_gmail.com>
Date: Fri, 14 Jan 2005 10:19:17 -0600

I guess I could, but that seems like extra overhead. I thought maybe
there was some property in JAXB to tell it to not validate the
namespace URI, or something along those lines. Is there something
similar to this?


On Fri, 14 Jan 2005 17:18:53 +0100, Aleksei Valikov <valikov_at_gmx.net> wrote:
> Hi.
>
> > Is there a way to tell JAXB to ignore the namespace URI on
> > unmarshalling? Here is my problem:
> >
> > I have a schema supplied by a vendor. They give a namespace URI in
> > the xsd file. I've generated the JAXB classes from this. When I
> > receive xml responses from this vendor, they don't include the
> > namespace URI in their xml, so I get this error when unmarshalling:
> >
> > org.xml.sax.SAXParseException: unexpected root element (uri:"",
> > local:"PoweredHotel_SingleAvailabilityReply"). Expected elements are
> > <{http://www.amadeus.net}PoweredHotel_SingleAvailabilityReply>,<{http://www.amadeus.net}MessagesOnly_Reply>,<{http://www.amadeus.net}PoweredHotel_SingleAvailability>
> >
> > I think I can remove the namespace URI from the schema, but I don't
> > really want to do this, because if the schema changes I will have to
> > do this every time. Is there a way to have JAXB not throw this error
> > when a namespace isn't present in the xml document?
>
> Why don't you simply pre-process the incoming document to add the
> namespace appropriately?
> There are different ways tto do this: XSL, SAX filter etc.
>
> 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
>
>

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