XSD和serisliase反序列化c#

XSD和serisliase反序列化c#

本文介绍了XML XSD和serisliase反序列化c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

c#Null运算符中的XML XSD




推荐答案

1)没有手册。  XSD是一种标准的XML格式,但您的代码没有使用它,因此无关紧要。当您要确保XML文件符合特定格式时,可以使用它。

1) There is no manual.  XSD is a standard XML format but your code isn't using it so it doesn't matter. It is used when you want to ensure that an XML file meets a specific format.

2)从XML读取时,空值很可能很好。问题是你的代码很可能不会期望它为空,因此会爆炸。  XML序列化器应该没问题。

2) The null values are most likely fine when read from the XML. The issue is that your code is most likely not expecting it to be null and therefore blowing up.  The XML serializer should be just fine.

您已经发布了XML和生成的类型信息,但是您没有提供任何关于您获得的异常,触发它的调用堆栈以及异常时正在执行的代码。我们需要这个
了解失败的地方。另请注意,如果XML允许盖子为null,那么您的代码也需要在序列化后处理该案例。

You've posted the XML and generated type information but you haven't provided use with any information on what exception you're getting, the callstack that triggered it and the code that was being executed at the time of the exception. We'll need this to understand where the failure is. Also note that if the XML allows a lid to be null then your code needs to handle that case after serialization as well.

Michael Taylor

http:// blogs.msmvps.com/p3net

Michael Taylor
http://blogs.msmvps.com/p3net


这篇关于XML XSD和serisliase反序列化c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 08:04