Using jaxb marshal xmlns attribute missing from xml output

tankaya61

New Member
I have some jaxb objects that are generated from an xsd I created. Previously when I marshalled the content, the xml output looked like this:\[code\]<report xmlns="urn:com-test-person-data:v3"><person-data> .......(Data)</person-data></report>\[/code\]I have recently change over from coding on a Windows machine to a Mac. Nothing has changed in the jaxb objects I'm using. But now my marshalled output looks like this.\[code\]<report><person-data> .......(Data)</person-data></report>\[/code\]I've tried doing some digging to see what could've removed the xmlns attribute, but have had no luck. I use that attribute to check what version of my schema is being used, so it's important it's in the outputted xml fragment.Here's the code snippet where I call the marshaller:\[code\]final JAXBContext context = JAXBContext.newInstance(Report.class);final Marshaller marshaller = context.createMarshaller();marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); //$NON-NLS-1$marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);marshaller.marshal(reportJaxBObject, sw);\[/code\]Any ideas?
 
Back
Top