How to marshal without a namespace?

前端 未结 7 501
野的像风
野的像风 2020-12-01 06:33

I have a fairly large repetitive XML to create using JAXB. Storing the whole object in the memory then do the marshaling takes too much memory. Essentially, my XML looks lik

7条回答
  •  难免孤独
    2020-12-01 07:29

    There is a very simple way to get rid of namespace prefixes in your case: just set the attribute elementFormDefault to unqualified in your schema, like this:

    
    

    You will get the namespace prefix only in the first tag:

    
    

    I hope this helps.

    Regards Pawel Procaj

提交回复
热议问题