Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

JAXB Marshalling to XML loses xmlns from 3rd party xsd

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2198
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic