Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2008

Tip: Looking for answers? Try searching our database.

JAXB 2.0 Question?

Thread view: 
Z - 09 Mar 2008 04:18 GMT
Hi,

I have created Java classes from an XSD using IntelliJ 6 and JAXB 2.0
plugin. I have populated the object and when I try to marshal the
object, I am getting ns2 appended to my root (default) element. I have
added a XmlRootElement tag to my root element. For the sake of
simplicity, I tried to unmarshal an XML file and then marshal it again
(without doing anything in between) as seen next:

My original XML file looks like the following:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><MSG
xmlns="http://xxx.yyy.com/"><ACKNOWLEDGEMENT>Success</
ACKNOWLEDGEMENT></MSG>

When I unmarshal it and marshal it again (doing nothing in between), I
get:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><MSG
xmlns:ns2="http://xxx.yyy.com/"><ns2:ACKNOWLEDGEMENT>Success</
ns2:ACKNOWLEDGEMENT></MSG>

I have used the same techniques before and they worked successfully. I
do not think the problem is with the XSD. Could you please tell me why
am I getting ns2 appended to my root element? and how can I get rid of
it?

Thanks in advance
Arne Vajhøj - 09 Mar 2008 04:54 GMT
> I have created Java classes from an XSD using IntelliJ 6 and JAXB 2.0
> plugin. I have populated the object and when I try to marshal the
[quoted text clipped - 20 lines]
> am I getting ns2 appended to my root element? and how can I get rid of
> it?

It is a bug in the software.

The two XML's are not equivalent.

Arne


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.