-
Notifications
You must be signed in to change notification settings - Fork 101
multiple namespaces are serialized #103
Comments
Reported by ramazanyich2 |
Was assigned to snajper |
kohsuke said: Would it be possible for you to try the latest nightly build? I remember fixing If it still doesn't work, please reopen the bug so that it gets our attention. |
File: testJaxb.java |
ramazanyich2 said: |
ramazanyich2 said: |
File: TestClass1.java |
ramazanyich2 said: |
File: jaxb.index |
ramazanyich2 said: |
File: package-info.java |
ramazanyich2 said: |
File: package-info.java |
ramazanyich2 said: |
File: test.xml |
ramazanyich2 said: |
ktrapszo said: |
kohsuke said: In 1.0, we did what ramazanyich2 wanted us to do — namely, declare namespaces We can't make it any smarter, as in short of traversing the whole object tree, So in 2.0 we decided to change the behavior to always declare all the statically Given those background, at this point we are not planning to change this behavior. |
mindchi said: I am writing some web service code using CFX and JAXB. I check my code all the Please consider correcting this problem so I can continue using JAXB in |
aempinheiro said: This means that this issue represents quite a big problem. |
rustamabd said: I propose to have an optional feature (with a possibility to turn it on and off) to traverse the tree and eliminate unnecessary namespace declarations. This can be made even smarter; e.g. stop traversing after reaching 100th node. |
thst said: I understand that this would not work on a streaming output, but treewalking would have the same issue. |
ajsmen said:
What about lazily on-demand add namespaces to some sort of set during document creation and at the end append all of them to the root element? |
This issue was imported from java.net JIRA JAXB-103 |
What's the consensus around adding a setting that has the marshaller run an extra pass through the document and eliminate unused namespaces? |
We are in a process of converting of converting a lot of legacy code that was using Apache XMLBeans to JAXB, this was a feature provided there OOB; and is stopping us from doing a (clean) migration. We now have workarounds to only create a Providing a feature toggle for this new functionality would be great |
have two separate packages
com.company1.doc
and com.company2.doc
every package contains namespace definition (in package-info.java):
@javax.xml.bind.annotation.XmlSchema(namespace = "http://company1.com/doc")
package com.company1.doc;
and
@javax.xml.bind.annotation.XmlSchema(namespace = "http://company2.com/doc")
package com.company2.doc;
I initialize JAXBContext using JAXBContext.newInstance("com.company1:com.company2");
Then I construct java objects in both packages:
Problem is then I unmarshall documents of one package I see namespace of another
...package:
Is it possible to avoid printing of unused namespace ?
Environment
Operating System: All
Platform: All
Affected Versions
[2.0 EA1]
The text was updated successfully, but these errors were encountered: