Closed MikeCheel closed 6 years ago
Hi,
Typically when NullFlavor is set, sub-elements should not be rendered (as the parent is null). I think you can suppress the generation of XSI:NIL by using the SettingsType.SuppressXsiNil setting when you create the formatter:
formatter.Settings = formatter.Settings | SettingsType.SuppressXsiNil;
I figured it out. I needed to set the Entry to NullFalvor.NoInformation (and the other stuff doesn't get nil'd) and not the Section. Thanks for your assistance!
I have Section objects that I am setting the Code, Title, and Text properties on.
When I have entries for the section, I create the Entry objects and add them to the Section object. At document creation time everything looks good and validates.
When I do NOT have entries I am setting
section.NullFlavor = NullFlavor.NoInformation;
and all I get at document creation time for the section is:<section xsi:nil="true" nullFlavor="NI" />
The problems are:
When I validate I get
The other properties (like Code, Title and Text) are not rendered to the xml.
What am I doing wrong?