• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Objects to XML creation using JAXB

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to convert my Java Objects into XML file.
I got these Objects from XSD's using xjc .
I got the XML file but along with the namespace prefix(ns2) that i have not set.
The resulting XML is like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:authenticateAndAuthorize xmlns:ns2="http://www.XXXXX.com/AuthenticateAndAuthorize" xmlns="http://www.XXXXX.com/UserManagement">
<ns2:authentication>
<applicationId>0</applicationId>
</ns2:authentication>
<ns2:user>
<displayName>name</displayName>
<password>personal</password>
<registrationStatus>registered</registrationStatus>
</ns2:user>
</ns2:authenticateAndAuthorize>

Is there any way to remove/change this prefix (ns2)?

Any help would be appreciated.

Sumit
 
No holds barred. And no bars holed. Except this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic