Win a copy of TDD for a Shopping Website LiveProject this week in the Testing 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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.
 
Do Re Mi Fa So La Tiny Ad
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic