什么时候确定使用XML文件来保存的信息?什么时候、文件、信息、XML

2023-09-03 04:56:39 作者:久居孤岛〞无人问

可能有对使用XML来保存的信息什么原因呢?

What reason could there be for using an XML to save information?

推荐答案

可能有很多原因:像任何其他文件格式,它有优点和缺点:

There could be lots of reasons: like any other file format, it has pros and cons:

优点:

的.Net本身支持序列化的对象到XML,然后再返回反序列化它们。 它比二进制格式或JSON 更可读的和描述对人眼 这是很容易验证对一个架构,确保它在正确的格式。 可以加载和分析与其他工具。 这是很容易互换与其他平台/语言,不同的是本机.NET二进制序列化格式 在这可以转化的,你可以在它的XPath运行。 .Net natively supports serializing your objects to xml, and deserializing them back again. It is more readable and descriptive to the human eye than a binary format or JSON It is easily validated against a schema to ensure it is in the correct format. It can be loaded and parsed with other tools. It is easily interchangeable with other platforms/languages, unlike the native .Net binary serialization format It can be transformed, and you can run xpath over it.

缺点:

这是比任何本地.NET二进制序列化格式更详细的,或JSON 在它不存储有关被反序列化到XML的类类型的信息,而本机二进制格式一样。
 
精彩推荐
图片推荐