Code Snipets

Sharepoint – Infopath : Schema validation found non-datatype errors

Posted in Sharepoint by mauliksoni on August 30, 2010

You may get the ‘Schema validation found non-datatype errors’ when opening an InfoPath form after it has been updated programatically.

Cause is -
White space is not being preserved when using xpath to update the form.

Solution is set PreserveWhiteSpace =True on XMLDocument object.

XmlDocument originalDoc = new XmlDocument();
s = originalItem[0].File.OpenBinaryStream();
originalDoc.Load(s);
originalDoc.PreserveWhitespace = true;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.