Xml Serialization vs. “True” and “False”

前端 未结 10 1055
傲寒
傲寒 2021-01-07 20:23

I\'m having an issue with deserializing an XML file with boolean values. The source XML files I\'m deserializing were created from a VB6 app, where all boolean values are c

10条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-07 20:31

    There isn't. The XML Serializer works with XML Schema, and "True" and "False" are not valid booleans.

    You could either use an XML Transform to convert these two values, or you could implement the IXmlSerializable interface and do the serialization and deserialization on your own.

提交回复
热议问题