• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAXB Marshalling to XML loses xmlns from 3rd party xsd

 
Robert Hulme
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I am using NetBeans 7.0.1 with JDK 6.0.27. I have created a JAXB Binding. The XSD document is supplied by a vendor. When I create an XML document using JAXB the marshalled output is missing some of the xmlns tags specified in the venodrs XSD document.

Vendors XSD Doc...


JAXB Marshalled XML...


The plaza & xs namespace tags are missing from the XML output. I believe they are missing since they are not used by the rest of the document so the marshaller ignores them. However, my vendor is querying why the xmlns schema tags are missing.

Is there a way of forcing the marshaller to output these namespaces.

I have tried amending package-info and adding my own namespaces but this has no effect on the output. (I don't like amending this file as it is reset each time I regenerate Java Code from the JAXB binding)



Any help would be appreciated. Thanks.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I would explain to the customer that the namespace declarations are not used and that their absence does not affect the usability of the XML data.
Trying to add the namespace prefixes in any way will only cause problems in the long run.
Best wishes!
 
Robert Hulme
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. I suspected as much. I just wish there was a way of forcing the output as I know that it will come back to me as to why I couldn't provide the XML file in the format they wanted even if it is wrong.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!