Hi,
I have code in a browser-enabled form that clones a node to create a new sibling and then overwrites several values on the new node. On one of the fields I got the error, “Schema validation found non-data type errors.” I found a blog from the InfoPath team saying that the error could be caused by a nillable field. (Here is the link in case you are interested:
http://blogs.msdn.com/infopath/archive/2006/11/28/the-xsi-nil-attribute.aspx ) As per the blog entry, I added code to remove the nil attribute.
Unfortunately, this caused another problem. If I then try to clone the new node to create another sibling, I get the error, "Only white space characters should be used." This error only happens if you try to make a copy of a node that had the nil attribute removed from one of its member elements.
Here is an excerpt from the code where the "white space" error shows up.
XmlWriter writer = lastChangeOrder.InsertAfter();
writer.WriteNode(lastChangeOrder, true); // <-- Error happens here.
writer.Close();
lastChangeOrder.MoveToNext();
Any ideas? Thanks!