开发者

Is there a way to avoid self-closing tags when using XML Serialization?

开发者 https://www.devze.com 2023-02-09 09:43 出处:网络
I am working with VB.NET and I am facing a problem with XML serialization. When empty values exists in the object I am serializing, the XML file contains the f开发者_如何学Collowing tags:

I am working with VB.NET and I am facing a problem with XML serialization. When empty values exists in the object I am serializing, the XML file contains the f开发者_如何学Collowing tags:

<tagName/>

instead of:

<tagName></tagName>

I know that it's the same, but I want the start tag to close appropriately.


They are the same and it makes no difference. Any parser or reader understands the meaning, so why is this so important to change?

I find the current behavior better as it will result in smaller files.

Regardless, there is no way to override this behavior.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号