users@jaxb.java.net

Can namespace be added during unmarshall

From: Praseeda Sathaye <praseeda_at_yahoo.com>
Date: Mon, 6 Oct 2008 11:13:48 -0700 (PDT)

The
xml file "convertedString" in the below example does not have namespace so when it
unrmarshal's this xml, there are no values inside Foo object. If I manually add
namespace to the xml "convertedString" it works. Is there any way to add namespace to the
UnMarshaller???
 
JAXBContext jc = JAXBContext.newInstance("com.foo.bar");
Unmarshaller u = jc.createUnmarshaller();
 
JAXBElement<Foo> root = u.unmarshal(new StreamSource(new StringReader(convertedString)),
Foo.class);