JAXB Namespace on each xml tag

前端 未结 1 1618
你的背包
你的背包 2021-01-28 16:21

Im using jaxb to generate XML Request. Below are all the code details. I have also tried the package-info thing, but it didn\'t worked for me. Like i want to add the namespace o

相关标签:
1条回答
  • 2021-01-28 17:06

    I would like to refer you to the following answer by @MichaelKay:

    https://stackoverflow.com/a/50300327/303810

    It is not the same question, but it is the same answer:

    In XML applications the principle should be:

    (a) Receiving applications shouldn't care about the insignificant lexical detail of how the XML is written. (The best way of achieving this is to use a respectable XML parser to read the XML.)

    (b) Writing applications should be free to use whatever lexical conventions they find convenient. (Which means you can use any respectable serialization library to write the XML.)

    Basically, you should not care. If you do, there's something seriously wrong with the way you process XML. It must not matter how namespaces are declared. Why should it?

    To answer your question, this is not possible with standard JAXB.

    0 讨论(0)
提交回复
热议问题