My schema contains some nillable fields (integer, datetime, and others mentioned in http://blogs.msdn.com/infopath/archive/2006/11/28/the-xsi-nil-attribute.aspx).
In my template.xml, these fields contain the attribute xsi:nil="true", but the xsi:nil is not present in sampledata.xml. This makes sense becase the arribute is not truly an attribute of my schema (I did not add it via code or in Design).
However, after I submit a form, the xsi:nil="true" is present in the raw xml file that is saved. Why is it here if it's not part of the true schema?
I have custom code that I use to update a file to the new form template. I use sampledata.xml as my template, so xsi:nil is not there. Then, after I update the form, when I try to submit an error is thrown on the date or integer or whatever because a value is expected. So, in my update code, I tried manually adding an xsi:nil attribute to the field, but then I get an error that nil is unexpected according to the schema.
When I step through the old xml file when it is being uploaded, xsi:nil is treated as an attribute, and is contained in IXMLDOMNode.attributes, so why doesn't it throw an error under this circumstance?
I guess I am just at a loss on how this "attribute" should be treated. How can it be in the xml and treated exactly like attribute in one scenario but not another?
Any clarification anyone can give is much appreciated. Thanks!