-
I am using I am trying to serialize a I have tried using I'm unable to identify where I'm going wrong, and am looking for some help to point me in the right direction. I'd like it so that only the root element XML configuration:
SerializersModule:
Relevant Classes:
FancyHouseSerializer:
Example of what I'm seeing where the unwanted blank xmlns attribute is serialized on
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I was able to get around this issue (no longer seeing blank namespace in
|
Beta Was this translation helpful? Give feedback.
-
I'm assuming that you want If you give the namespace explicitly it works (in my test case), the problem is that it defaults to the empty namespace (not the one of the parent tag as is the behaviour of `XmlSerialName). |
Beta Was this translation helpful? Give feedback.
I think you are confused as to how it works. In your example you declare that HouseCreationRequest lives in the "http://mynamespace.com" namespace with the default prefix. The
xmlns
namespace declaration just specifies the prefix/namespace mapping. All tags have a namespace, based on the prefix of the element (also if empty). SoHouse
,Location
,FloorDetails
,FloorDetail
,Bathrooms
andBathroom
are all in that namespace, but because you use the default namespace this is not possible. The bug with@XmlChildrenName
is that instead of inheriting the namespace it uses the empty namespace. That is the reason you see thexmlns=""
attribute onFloorDetail
because it is now in the default/empty n…