开发者

XML ignore attribute

开发者 https://www.devze.com 2023-04-12 22:50 出处:网络
I want to set [XmlIgnore] attribute on class because I want it to be sk开发者_运维知识库ipped in deserialization, but I want to keep its children to be deserialized.

I want to set [XmlIgnore] attribute on class because I want it to be sk开发者_运维知识库ipped in deserialization, but I want to keep its children to be deserialized.

is it possible to do so?

Thanks.


It makes no sense to want to deserialise children of an attribute you have not deserialised. There is nowhere for them to go - it's a bit like saying I want to create the properties of a class but not the class itself.

If you really wanted to do this I think you would have to write your own XML parser and then find somewhere to stick them - doesn't make sense to me.

0

精彩评论

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

关注公众号