{"id":301,"date":"2016-04-21T11:00:09","date_gmt":"2016-04-21T15:00:09","guid":{"rendered":"https:\/\/www.ccrossan.com\/?p=301"},"modified":"2016-07-07T08:00:08","modified_gmt":"2016-07-07T12:00:08","slug":"programatically-setting","status":"publish","type":"post","link":"https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/","title":{"rendered":"Schema Validation Errors While Setting an XML Node Value"},"content":{"rendered":"\n<div class=\"twitter-share\"><a href=\"https:\/\/twitter.com\/intent\/tweet?via=crossan007\" class=\"twitter-share-button\">Tweet<\/a><\/div>\n<p>When attempting to set the node value in an InfoPath form with code, &#8220;schema validation&#8221; errors may appear. \u00a0 This is primarily caused by attempting to set the value of a field with one of the following data types:<\/p>\n<ul>\n<li>Whole Number (integer)<\/li>\n<li>Decimal (double)<\/li>\n<li>Date (date)<\/li>\n<li>Time (time)<\/li>\n<li>Date and Time (dateTime)<\/li>\n<\/ul>\n<p>The workaround is to remove the &#8220;nil&#8221; attribute from the element:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\npublic void DeleteNil(XPathNavigator node)\r\n{\r\nif (node.MoveToAttribute(\u201cnil\u201d, \u201chttp:\/\/www.w3.org\/2001\/XMLSchema-instance\u201d))\r\n      node.DeleteSelf();\r\n}\r\n<\/pre>\n<p>Additional Resources:<\/p>\n<ul>\n<li>\u00a0<a href=\"https:\/\/blogs.msdn.microsoft.com\/infopath\/2006\/11\/28\/the-xsinil-attribute\/\">https:\/\/blogs.msdn.microsoft.com\/infopath\/2006\/11\/28\/the-xsinil-attribute\/<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>When attempting to set the node value in an InfoPath form with code, &#8220;schema validation&#8221; errors may appear. \u00a0 This is primarily caused by attempting to set the value of a field with one of the following data types: Whole Number (integer) Decimal (double) Date (date) Time (time) Date and Time (dateTime) The workaround is &hellip; <a href=\"https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Schema Validation Errors While Setting an XML Node Value<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[128],"tags":[129,130,131,10,132],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Schema Validation Errors While Setting an XML Node Value - Charles&#039; Blog\" \/>\n<meta property=\"og:description\" content=\"When attempting to set the node value in an InfoPath form with code, &#8220;schema validation&#8221; errors may appear. \u00a0 This is primarily caused by attempting to set the value of a field with one of the following data types: Whole Number (integer) Decimal (double) Date (date) Time (time) Date and Time (dateTime) The workaround is &hellip; Continue reading Schema Validation Errors While Setting an XML Node Value &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/\" \/>\n<meta property=\"og:site_name\" content=\"Charles&#039; Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-04-21T15:00:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-07-07T12:00:08+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"crossan007\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/crossan007.dev\/blog\/#website\",\"url\":\"https:\/\/crossan007.dev\/blog\/\",\"name\":\"Charles&#039; Blog\",\"description\":\"SharePoint | PowerShell | Exchange | SCCM | Ubuntu | PHP | JavaScript | A\/V Live Production | More...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/crossan007.dev\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/#webpage\",\"url\":\"https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/\",\"name\":\"Schema Validation Errors While Setting an XML Node Value - Charles&#039; Blog\",\"isPartOf\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/#website\"},\"datePublished\":\"2016-04-21T15:00:09+00:00\",\"dateModified\":\"2016-07-07T12:00:08+00:00\",\"author\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979\"},\"breadcrumb\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/crossan007.dev\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Schema Validation Errors While Setting an XML Node Value\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979\",\"name\":\"crossan007\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/crossan007.dev\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g\",\"caption\":\"crossan007\"},\"url\":\"https:\/\/crossan007.dev\/blog\/author\/crossan007\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/","og_locale":"en_US","og_type":"article","og_title":"Schema Validation Errors While Setting an XML Node Value - Charles&#039; Blog","og_description":"When attempting to set the node value in an InfoPath form with code, &#8220;schema validation&#8221; errors may appear. \u00a0 This is primarily caused by attempting to set the value of a field with one of the following data types: Whole Number (integer) Decimal (double) Date (date) Time (time) Date and Time (dateTime) The workaround is &hellip; Continue reading Schema Validation Errors While Setting an XML Node Value &rarr;","og_url":"https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/","og_site_name":"Charles&#039; Blog","article_published_time":"2016-04-21T15:00:09+00:00","article_modified_time":"2016-07-07T12:00:08+00:00","twitter_misc":{"Written by":"crossan007"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/crossan007.dev\/blog\/#website","url":"https:\/\/crossan007.dev\/blog\/","name":"Charles&#039; Blog","description":"SharePoint | PowerShell | Exchange | SCCM | Ubuntu | PHP | JavaScript | A\/V Live Production | More...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/crossan007.dev\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/#webpage","url":"https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/","name":"Schema Validation Errors While Setting an XML Node Value - Charles&#039; Blog","isPartOf":{"@id":"https:\/\/crossan007.dev\/blog\/#website"},"datePublished":"2016-04-21T15:00:09+00:00","dateModified":"2016-07-07T12:00:08+00:00","author":{"@id":"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979"},"breadcrumb":{"@id":"https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crossan007.dev\/blog\/infopath\/programatically-setting\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/crossan007.dev\/blog\/"},{"@type":"ListItem","position":2,"name":"Schema Validation Errors While Setting an XML Node Value"}]},{"@type":"Person","@id":"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979","name":"crossan007","image":{"@type":"ImageObject","@id":"https:\/\/crossan007.dev\/blog\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g","caption":"crossan007"},"url":"https:\/\/crossan007.dev\/blog\/author\/crossan007\/"}]}},"_links":{"self":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/301"}],"collection":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/comments?post=301"}],"version-history":[{"count":3,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/301\/revisions"}],"predecessor-version":[{"id":377,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/301\/revisions\/377"}],"wp:attachment":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/media?parent=301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/categories?post=301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/tags?post=301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}