Problem: An empty element is being deserialized to a null value, but the class generator never marks it as nullable.
I have a very basic element generated using the following flags: --sf --nu -d --cn -t- --ct=System.Collections.Generic.List`1 --nullable --nr
I've tried my best to make the below Value property be marked as nullable, but it is not. This would lead me to believe that it will always have a value when this class is derialized. This is not the case, however, as when there is an empty element such as <OUTPUT2/>, the Value property is null.
Hope that makes sense, if anyone can tell me what I'm doing wrong that would be great. We either want this property to be marked as nullable, or for it to never be set to null. Thanks!
[GeneratedCodeAttribute("XmlSchemaClassGenerator", "3.0.1198.0")]
[SerializableAttribute()]
[XmlTypeAttribute("MXStringType", Namespace="http://www.ibm.com/maximo")]
[DebuggerStepThroughAttribute()]
[DesignerCategoryAttribute("code")]
public partial class StringType
{
/// <summary>
/// <para xml:lang="en">Gets or sets the text value.</para>
/// </summary>
[XmlTextAttribute()]
public string Value { get; set; }
}
The XSD for this is:
<xsd:complexType name="StringType">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="changed" type="ChangeIndicatorType" use="optional" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
Problem: An empty element is being deserialized to a null value, but the class generator never marks it as nullable.
I have a very basic element generated using the following flags: --sf --nu -d --cn -t- --ct=System.Collections.Generic.List`1 --nullable --nr
I've tried my best to make the below Value property be marked as nullable, but it is not. This would lead me to believe that it will always have a value when this class is derialized. This is not the case, however, as when there is an empty element such as
<OUTPUT2/>, the Value property is null.Hope that makes sense, if anyone can tell me what I'm doing wrong that would be great. We either want this property to be marked as nullable, or for it to never be set to null. Thanks!
The XSD for this is: