users@jaxb.java.net

Ignoring Namespace URI on Unmarshalling

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

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?

Thanks.

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