Skip to content

Problems with namespaces in xml files from third party #198

Answered by pdvrieze
StefanMMS asked this question in Q&A
Discussion options

You must be logged in to vote

The issue is with the way that namespace inheritance works. In other words, it tries to make a guess, and there was a problem with the guessing. Also, for the root element only, it will use whatever name the element actually has in the document rather than the one declared on the type.
Another factor to consider is that the default parameter values for @XmlSerialName are interpreted as automatic prefix/namespace rather than empty. Given your data your DTO is actually incorrect in that you need to set the namespace (and thus XmlSerialName on all members). The current DTO rather relies on compatibility logic (it has no namespace, but is parsed as if it has a namespace - it should have a nam…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@StefanMMS
Comment options

@pdvrieze
Comment options

Answer selected by StefanMMS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants